Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block TOR Servers

I need a script that blocks TOR servers in php ... I need to get the list of servers and block them.

Or, any solution to install on the server (centos).

like image 681
Maxpower Avatar asked Dec 03 '22 04:12

Maxpower


1 Answers

Here is more information about TorDNSEL https://www.torproject.org/projects/tordnsel.html.en and how to structure query.

And below is function I found on the net that can perform dynamic checks.

( https://check.torproject.org/ must use something similar to this ).

I am not sure about performance under heavier traffic.

function IsTorExitPoint(){
if (gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
} 
}
function ReverseIPOctets($inputip){
$ipoc = explode(".",$inputip);
return $ipoc[3].".".$ipoc[2].".".$ipoc[1].".".$ipoc[0];
}
like image 178
Pawel Wodzicki Avatar answered Dec 11 '22 09:12

Pawel Wodzicki