LandonC
LandonC

Reputation: 899

Tor NEWNYM is NOT working with C#

I have reviewed every question/response on stackoverflow regarding how to change the exit node IP for Tor programmatically to no avail. Every answer says that all you have to do is connect to the Tor control port and issue the "signal newnym" command, and you'll get a new exit IP. I'm using the Minimalistic Telnet Library to issue the following:

TelnetConnection tc = new TelnetConnection("127.0.0.1", 9051);
tc.WriteLine("AUTHENTICATE \"pwd\"");
tc.WriteLine("SIGNAL NEWNYM");
tc.WriteLine("QUIT");

I've added line endings, tried different Telnet libraries and direct TCP connections, and none of it works. I'm scraping a page on our development server that displays the requesting IP, and when I call this page in a loop, stopping on occasion to issue the "newnym" command, the IP address never changes. Does anybody have any idea what I'm doing wrong? Sorry to submit what appears to be a duplicate, but since none of the answers work, I don't really consider it a dupe. Thanks.

Upvotes: 4

Views: 2760

Answers (2)

nopara73
nopara73

Reputation: 522

NEWNYM does not destroy existing circuits, it marks them dirty and builds new ones (among other things). Just dispose the existing TCP connections and when you build new ones you will get a new IP.

Upvotes: 1

guest
guest

Reputation: 46

If you run a TOR relay the signal NEWNYM has no effect. it works only for TOR clients for browsing the internet. It means new identity, new circuit.

If Tor chose to ignore a signal (such as NEWNYM), this event will not be sent. Note that some options (like ReloadTorrcOnSIGHUP) may affect the semantics of the signals here.

Note that the HALT (SIGTERM) and SHUTDOWN (SIGINT) signals do not currently generate any event.

Upvotes: 0

Related Questions