I would like to force TOR change the IP on every request. Or at least every few seconds.
Also, it would be great if the solution will work both on Linux and Windows.
Anyone knows how can I achieve this?
I found this PHP code which claims to be what I am looking for but I cannot understand what it is doing.
<?php
$fp = fsockopen('127.0.0.1', 9051, $errno, $errstr, 30);
$auth_code = 'YOUR_PASSWORD';
if ($fp) {
echo "Connected to TOR port<br />";
}
else {
echo "Cant connect to TOR port<br />";
}
fputs($fp, "AUTHENTICATE \"".$auth_code."\"\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code = '250') {
echo "Authenticated 250 OK<br />";
}
else {
echo "Authentication failed<br />";
}
fputs($fp, "SIGNAL NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code = '250') {
echo "New Identity OK<br />";
}
else {
echo "SIGNAL NEWNYM failed<br />";
die();
}
fclose($fp);
?>
Somebody?
It connects via Socket to your local tor relay, authenticates and sends a SIGNAL NEWNYM
, which forces the tor relay to change the identity and exit node.
See more at
There is even a SE site about tor.