Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Code adapted from a Tor-talk message by °¤¦¦Ç£ówñ_Ðèvï£_ß󥦦¤° [clowndevil at gmail.com]; Thu Aug 3 17:25:55 UTC 2006 https://lists.torproject.org/pipermail/tor-talk/2006-August/001738.html
- ' This script is intended to give Windows users a way to send the NEWNYM () signal to Tor. Non-Windows users have other options, including Arm (https://www.torproject.org/projects/arm.html.en).
- ' As of TorBrowser 3.0alpha1 Vadalia is no longer included, which means we no longer have an easy to send the NEWNYM signal, so I brought this old code back from the dead.
- ' This is how I used ot control Tor before Vadalia and other GUI's came along (circa 2006) . . . other signals can be sent, too, e.g. HUP, SHUTDOWN, etc.
- ' Important comments by Robert Ransom, and others: https://lists.torproject.org/pipermail/tor-talk/2011-March/019725.html
- 'Make torsock out socket name
- set torsck = CreateObject("Toolsack.Socket")
- 'Connect to Tor's control port
- torsck.Connect "localhost", 9051
- 'Auth so we can send commands
- torsck.Write "AUTHENTICATE" & vbcrlf
- 'Read the buffer so we know what to do
- chktxt = torsck.ReadLine
- if (chktxt = "250 OK") then
- 'If we get an OK then send the NEWNYM signal
- torsck.Write "SIGNAL NEWNYM" & vbcrlf
- else
- 'Other wise goto a failed message box
- call failed
- end if
- 'Again read the buffer
- chktxt = torsck.ReadLine
- if (chktxt = "250 OK") then
- 'If we get an OK then Tor carried out NEWNYM fucntion and user is using a different Exit node
- 'As per Lunar'S commonets on the Tor Blog: https://blog.torproject.org/blog/tor-browser-bundle-30alpha3-released#comment-33544
- msgbox "All subsequent connections will appear to be"&_
- "different than your old connections. This means the"&_
- "subsequent Tor route (circuit) will use a different"&_
- "Exit node and therefore a different IP address."&_
- ""&_
- "WARNING: This script *only* sends the NEWNYM"&_
- "signal to Tor, which instructs Tor to use a different"&_
- "Exit node (IP address) than the one its currently using."&_
- "This script *does not* create unlinkable new pseudoanonymous"&_
- "Tor 'identity' for the user! This script is *not* a replacement"&_
- "for TorBrowserButton's 'New Identity' feature"&_
- ""&_
- "As per Lunar: [After using this script with TorBrowser,] any"&_
- "cookies that had been [previously] set by a website would make it"&_
- "possible to link between the old and the new [Exit node] IP address."&_
- "The [TorBrowserButton closes all TorBrowser tabs when a user selects"&_
- "its New Identity feature and re-launches TorBrowser so it can reset]"&_
- "the internal browser state, [which] is the only way to provide"&_
- "unlikable visits to the same site (or ad networks for that matter)."
- else
- 'Other wise goto failed message box
- call failed2
- end if
- 'Everything went good so finish the connection
- call finish
- sub failed
- 'Message box for failed auth
- msgbox "Failed to authenticate to Tor."
- call finish
- end sub
- sub failed2
- 'Message box for failed NEWNYM signal
- msgbox "Failed to send NEWNYM signal; you're still using the same Tor route (circuit)."
- call finish
- end sub
- sub finish
- 'Send a QUIT command to Tor and close the connection
- torsck.Write "QUIT" & vbcrlf
- 'Again read the buffer
- chktxt = torsck.ReadLine
- if (chktxt = "250 closing connection") then
- 'Do nothing because the Tor closed the connection for us
- else
- 'Something happen when trying to clsoe the connection so close it anyway
- torsck.Close
- end if
- end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement