4

In the new Tor browser bundle is there any way to change new identity programmatically, since there is no Vidalia bundle?

  • 2
    Do you mean how to request creation of a new Tor circuit using a command line tool or API? – pabouk Feb 2 '14 at 22:36
  • yes exactly thats what I am looking for – Vijay kudal Feb 3 '14 at 4:49
  • 2
    You also asked a similar question here: tor.stackexchange.com/q/1414/88 Please don't ask the same question more than one time. It might take some time until one finds an answer. – Jens Kubieziel Feb 3 '14 at 23:07
  • 1
    You can download Vidalia yourself in Tor website – user3092 Jul 5 '14 at 6:12
1

I'm not aware of some ready-made solution. However you could write an expect script for your shell:

The first part reads out the cookie file and calls the expect script

#!/bin/sh
COOKIEFILE=/var/lib/tor/control_auth_cookie
if [ -f $COOKIEFILE  ]; then
  COOKIE=$(hexdump -e '32/1 "%02x""\n"' $COOKIEFILE)
else
  echo "Cookie not found"
  return 1
fi

expect -f tor-newnym.exp $COOKIE

The expect script is just an idea. Maybe you'll need to set some additional values later:

#!/usr/bin/expect -f
set cookie [lindex $argv 0]
spawn telnet 127.0.0.1 9050
expect -exact "Trying 127.0.0.1...\r
Connected to 127.0.0.1.\r
Escape character is '^]'.\r
"
send -- "AUTHENTICATE $cookie\r"
expect -exact "250 OK\r
"
send -- "signal NEWNYM\r
"
expect -exact "250 OK\r
"
send -- "quit\r"
expect eof

This takes the cookies and sends it to the Tor process. However please be aware that the port of your Tor process might be another one. Furthermore the chain of command might be too fast, so you have to slow it down.

  • Thanks 1) in windows how can I mae it work? – Vijay kudal Feb 8 '14 at 9:38
  • Tor uses now a ControlSocket by default. Replace the spawn and first expect command above with spawn nc -U {$HOME/Library/Application Support/TorBrowser-Data/Tor/control.socket} (if you have BSD's netcat) or use telnet -u [socket]. – 1.61803 Apr 1 '17 at 13:47
1

You can change identity using green Tor button. This is the best choice. However, you still can activate Vidalia manually and change identity that way. (not recommended)

  • 1
    Thanks but i want to change progmatically means thru script or command line – Vijay kudal Feb 3 '14 at 4:48
  • HI I am still looking for solution for windows – Vijay kudal Jul 27 '14 at 9:54
0

On GNU/Linux, there is the tor command and we can change the country exit node with a single command tor -ExitNodes {fr} for France or tor -ExitNodes {de} for Germany (Deutschland) for example. But to create a new circuit to change the IP address, I have to press Ctrl+C and start the command again.

I don't think there is an interactive shell, or command parameter to create a new circuit. If you do it programmatically, you will have to kill the process and start it again, so if someone has an easier solution to change the identity, your welcome.

A cleaner method would be to use the NEWNYM signal like @Jens Kubieziel said but it would be easier if it was available as a command parameter like tor -new-identity or tor -new-circuit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.