3

I tried connecting to tor in TBB 3.5.1, OS X 10.8.5 using telnet localhost 9151 but since CookieAuthentication is set it requires authentication.

From the manual

CookieAuthentication 0|1 If this option is set to 1, allow connections on the control port when the connecting process knows the contents of a file named "control_auth_cookie", which Tor will create in its data directory. This authentication method should only be used on systems with good filesystem security. (Default: 0)

I checked RFCs and other sources for TELNET/telnet but I couldn't find any information on this matter.

How can I authenticate using the cookie?

1.61803
  • 193
  • 2
  • 9

1 Answers1

2
  1. Locate the file control_auth_cookie
  2. Enter hexdump -e '32/1 "%02x""\n"' $COOKIEFILE where $COOKIEFILE is the location of the file from step 1.
  3. Copy the output
  4. Open a shell and enter telnet 127.0.0.1 9151. If you can't get a connection check if Tor listens on that port. Other versions listens on port 9050.
  5. When you see a prompt enter AUTHENTICATE $OUTPUTFROM2 where $OUTPUTFROM2 is the output you copied from step 2.
  6. Tor prints 250 OK and you're done.

If you like to put the steps above in a program, I'd suggest a shell script plus expect. In the answer to 'New tor bundle how to change identity programmatically?' I described how to do it for NEWNYM. You just need to insert the line send -- "getinfo circuit-status" at the correct line.

Jens Kubieziel
  • 8,630
  • 5
  • 35
  • 116