从Windows命令行请求新的身份 [英] Request new identity from Windows command line

查看:275
本文介绍了从Windows命令行请求新的身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用一个简单的Windows命令行命令来更改TOR标识。我看到很多Linux的例子,但不知道如何在Windows上实现同样的事情。



任何人都有什么想法?

解决方案

要在Windows上创建一个新的电路(切换IP地址),而不停止和启动Tor,您需要打开一个连接Tor的控制端口发出 NEWNYM 信号。



这是一个批处理文件,将实现这一点。您还需要下载


I'm trying to use a simple Windows Command Line command to change TOR identities. I see plenty of examples for Linux, but not sure how to implement the same thing on Windows.

Anyone have any ideas?

解决方案

To create a new circuit (switch IP addresses) on Windows without stopping and starting Tor, you need to open a connection to Tor's 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 for Windows, so you will need to put this batch file in the root folder of the browser bundle.

@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 circuit changed and I had a new IP each time.

When you run it, you should 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 one-liner, you have to connect to the control port and issue this signal. This is what the browser does when you press the new identity button.

Here is the directory structure relative to the Tor Browser Bundle, nc, and the batch file to create a new circuit.

这篇关于从Windows命令行请求新的身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆