Request a new identity from the Windows command prompt

I am trying to use a simple Windows command line command to modify TOR volumes. I see many examples for Linux, but I don’t know how to implement the same thing on Windows.

Does anyone have any ideas?

+4
source share
3 answers

To create a new scheme (switch IP addresses) on Windows without stopping and starting Tor, you need to open a connection to the Tor control port to issue a NEWNYM signal.

Here is a batch file that will achieve this. You also need to download netcat for Windows and put nc.exe in the same folder as this batch file.

I downloaded the Tor Browser Bundle package for Windows, so you will need to put this batch file in the root folder of the browser package.

 @echo off REM Read control auth cookie into variable set /p auth_cookie=<Browser\TorBrowser\Data\Tor\control_auth_cookie REM Create file with control commands echo AUTHENTICATE "%auth_cookie%"> commands.txt echo SIGNAL NEWNYM>> commands.txt echo QUIT>> commands.txt REM Connect to control port and issue commands nc localhost 9151 < commands.txt REM Delete commands file del /Q commands.txt 

I tested this on Windows, and after running the batch file, my scheme changed, and each time I had a new IP address.

When you run it, you will see the following output:

 C:\Users\user\Desktop\Tor Browser>control.bat 250 OK <-- in response to AUTHENTICATE 250 OK <-- in response to SIGNAL NEWNYM 250 closing connection 

There is no simple single-line interface, you need to connect to the control port and issue this signal. This is what the browser does when you press the new authentication button.

Here is the directory structure for the Tor Browser package, nc and the batch file for creating a new scheme.

file structure

+9
source
  • Change the method for checking the tag control panel to "Password" (Settings | Advanced in the Vidalia Control Center) Example image

  • Download Netcat for Windows

  • Create a text file with commands for netcat named tor-change.txt

AUTHENTICATE "your password from control panel here" SIGNAL NEWNYM QUIT

  1. Create a .cmd file that will change ip every time it starts:

@echo off nc localhost 9151 < tor-change.txt

+1
source

Would you like to change the TOR ID while the TOR browser is still running?
Or you can finish and restart TOR with the cmd command. start PATH\firefox.exe
By the way, if you are not opposed to programmatically changing IDs / IPs using a Python script, look here: http://mehmetkurtipek.blogspot.com/2015/05/how-to-change-tor-browser-ip-or.html and here : Python - Tor control

0
source

All Articles