From 2003b5d8bc9c9b2b7aa72f4d3c4532c7349264cd Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 9 Jul 2010 09:50:01 -0400 Subject: Print a warning on the login screen if you are accessing the router by a non-local IP address (one not configured on the system) to warn about potential MITM attacks. --- etc/inc/authgui.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc index b3cd6a6..0747452 100644 --- a/etc/inc/authgui.inc +++ b/etc/inc/authgui.inc @@ -163,6 +163,24 @@ function display_login_form() { exit; } +/* Check against locally configured IP addresses, which will catch when someone + port forwards WebGUI access from WAN to an internal IP on the router. */ +global $FilterIflist; +$local_ip = false; +if(strstr($_SERVER['HTTP_HOST'], ":")) { + $http_host_port = explode(":", $_SERVER['HTTP_HOST']); + $http_host = $http_host_port[0]; +} else { + $http_host = $_SERVER['HTTP_HOST']; +} +if (empty($FilterIflist)) { + require_once('filter.inc'); + require_once('shaper.inc'); + filter_generate_optcfg_array(); +} +foreach ($FilterIflist as $iflist) + if($iflist['ip'] == $http_host) + $local_ip = true; ?>
+
If you did not setup this forwarding, you may be the target of a man-in-the-middle attack.")); ?>

-- cgit v1.1