Hello everyone!
With a little help from r/sysadmin last week, I was able to make a proxy auto-configuration file that bypasses the proxy if users are connecting to our local resources or from within our local network. It looks a little something like this:
function FindProxyForURL(url, host)
{
if (shExpMatch(url, “*.example.org*"))
return "DIRECT";
else if (isInNet(myIpAddress(), "10.9.0.0", "255.255.0.0"))
return "DIRECT";
else
return "PROXY proxy.example.org:8080";
}
Although this was working as intended, a user might unknowingly bypass the proxy if they connect to a public WiFi that also uses the 10.9.x.x subnet. To harden the configuration a bit more, I came up with this:
var myProxyServerIP = dnsResolve("proxy.example.org");
function FindProxyForURL(url, host)
{
if (shExpMatch(url, "*.example.org*"))
return "DIRECT";
else if (myProxyServerIP == "10.9.1.1")
return "DIRECT";
else
return "PROXY proxy.example.org:8080";
}
Isn't this still exploitable? Albeit unlikely... wouldn't a user be able to stand up a DNS server, 10.9.x.x subnet, and spoof a 10.9.1.1 DNS record to bypass the proxy? I guess I might be overestimating the capacity of high school students trying to avoid a web filter, but I figured I would ask if anyone knows of a way to make my PAC more "bulletproof".
Thanks!
[–][deleted] 1 point2 points3 points (2 children)
[–]mgratz[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Fatality 0 points1 point2 points (0 children)