From 202b30e428569b080e493df79ed77d213a0fa68e Mon Sep 17 00:00:00 2001 From: ljm42 Date: Mon, 23 Aug 2021 11:59:21 -0700 Subject: [PATCH] Diagnostics: add check for DNS Rebinding Protection --- plugins/dynamix/scripts/diagnostics | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/dynamix/scripts/diagnostics b/plugins/dynamix/scripts/diagnostics index 8a3e62003..2f7187815 100755 --- a/plugins/dynamix/scripts/diagnostics +++ b/plugins/dynamix/scripts/diagnostics @@ -154,6 +154,9 @@ function geturls() { $internalip_msg = "redacted (FYI - this system has a routable IP address, ensure it is behind a firewall)"; } $host_tld_msg = $var['LOCAL_TLD'] ? '': '[blank] (FYI - a blank TLD can cause issues for Mac and Linux clients)'; + $rebindip = "192.168.42.42"; + $rebindtest_ip = exec("host -4 rebindtest.unraid.net 2>/dev/null|sed -n 's/.*has address //p'"); + $rebind_msg = ($rebindtest_ip != $rebindip) ? "is enabled, hash.unraid.net urls will not work" : "is disabled, hash.unraid.net urls will work"; // show raw data from config files $urls = ''; @@ -162,7 +165,8 @@ function geturls() { $urls .= "HTTP port: {$var['PORT']}\n"; $urls .= "HTTPS port: {$var['PORTSSL']}\n"; $urls .= "Internal IP: {$internalip_msg}\n"; - $urls .= "USE SSL: {$var['USE_SSL']}\n\n"; + $urls .= "USE SSL: {$var['USE_SSL']}\n"; + $urls .= "DNS Rebinding Protection {$rebind_msg} on this network\n\n"; $urls .= "Available URLs:\n (the URL marked with an asterisk is the primary url for this server)\n"; // calculate variables