I friend, if I put the torlist.txt in the index should activate the Nastyhost?
foreach (file('torlist.txt') as $torIP) {
If (getIP () == trim ($torIP)) {
banned();
}
}
Greetings thank you.
The Tor list and NastyHosts both achieve different purposes. You should have both.
Also. I fixed your code. You only need the opening brace '{' on lines 1 and 2, not both braces.
OK thanks, seems that the code was changed when I put it here.
Then I activate Nastyhost to run the torlist?
Friend... you can do this way:
// Put your site IP bellow (you can ping your URL to get the IP)
$mySiteIp = '111.111.111.111'
//Get the visitor IP
$ip=$_SERVER['REMOTE_ADDR'];
//get the list of nodes that can achieve your site
$torList = file_get_contents("https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$mySiteIp&port=80");
//remove your IP address from the list. It is listed in the file header.
$torList = str_replace((string)$mySiteIp,"",$torList);
//check if the visitor IP is in the TOR list
if ((strpos((string)$torList, (string)$ip)) !== false)
{
banned();
}