TheVoidz
10-16-2003, 12:04 AM
So I was thinking of ways to block proxy users and I though why not do it like most IRC servers do and connect to the port to see if there is anything open on default proxy ports.
Once it has been determined that a certain IP is not a proxy it can be added to an allowed list and won't be checked again.
If a IP has been declared a proxy it will be added to a disallowed list and won't have access to the forums.
Thus putting a total end to proxy servers. wewt!
Comments, ideas? etc?
$Ports = array('1080', '8080', '8000', '3128', '8888', '23', '80', '8081');
$AllowedHosts = array('some list');
$DisallowedHosts = array('some list');
$SocketTimeout = 1;
if (in_array ($REMOTE_ADDR, $AllowedHosts)){
break;
} else {
if ((!in_array ($REMOTE_ADDR, $AllowedHosts)) && (!in_array ($REMOTE_ADDR, $DisallowedHosts))){
$x = 0;
while ($Ports[$x]){
$fSockPointer = fsockopen($REMOTE_ADDR, $Ports[$x], $errno, $errstr, $SocketTimeout);
if ($fSockPointer) {
$proxy = true;
fclose($fSockPointer);
}
$x++;
}
}
}
Once it has been determined that a certain IP is not a proxy it can be added to an allowed list and won't be checked again.
If a IP has been declared a proxy it will be added to a disallowed list and won't have access to the forums.
Thus putting a total end to proxy servers. wewt!
Comments, ideas? etc?
$Ports = array('1080', '8080', '8000', '3128', '8888', '23', '80', '8081');
$AllowedHosts = array('some list');
$DisallowedHosts = array('some list');
$SocketTimeout = 1;
if (in_array ($REMOTE_ADDR, $AllowedHosts)){
break;
} else {
if ((!in_array ($REMOTE_ADDR, $AllowedHosts)) && (!in_array ($REMOTE_ADDR, $DisallowedHosts))){
$x = 0;
while ($Ports[$x]){
$fSockPointer = fsockopen($REMOTE_ADDR, $Ports[$x], $errno, $errstr, $SocketTimeout);
if ($fSockPointer) {
$proxy = true;
fclose($fSockPointer);
}
$x++;
}
}
}