1
当我尝试在Windows 10上更新ip的时候,它总是失败(我已经通过大量的帖子堆栈溢出,如this和this,但没有任何东西作品)。通过标准的python套接字获得新的ip的Tor7.0
- 操作系统:Windows 10 64位
- TOR:7.0
内容我的torrc的
# This file was generated by Tor; if you edit it, comments will not be preserved
# The old torrc file was renamed to torrc.orig.1 or similar, and Tor will ignore it
DataDirectory C:\Users\yyyy\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor
GeoIPFile C:\Users\yyyy\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\geoip
GeoIPv6File C:\Users\yyyy\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\geoip6
HiddenServiceStatistics 0
HashedControlPassword 16:D14CC89AD7848B8C60093105E8284A2D3AB2CF3C20D95FECA0848CFAD2
CookieAuthentication 1 #either with nor without this line, still fail
的torrc,默认的目录
# torrc-defaults for Tor Browser
#
# DO NOT EDIT THIS FILE
#
# This file is distributed with Tor Browser and SHOULD NOT be modified (it
# may be overwritten during the next Tor Browser update). To customize your
# Tor configuration, shut down Tor Browser and edit the torrc file.
#
# If non-zero, try to write to disk less frequently than we would otherwise.
AvoidDiskWrites 1
# Where to send logging messages. Format is minSeverity[-maxSeverity]
# (stderr|stdout|syslog|file FILENAME).
Log notice stdout
CookieAuthentication 1
## fteproxy configuration
ClientTransportPlugin fte exec TorBrowser\Tor\PluggableTransports\fteproxy --managed
## obfs4proxy configuration
ClientTransportPlugin obfs2,obfs3,obfs4,scramblesuit exec TorBrowser\Tor\PluggableTransports\obfs4proxy
## meek configuration
ClientTransportPlugin meek exec TorBrowser\Tor\PluggableTransports\terminateprocess-buffer TorBrowser\Tor\PluggableTransports\meek-client-torbrowser -- TorBrowser\Tor\PluggableTransports\meek-client
脚本中使用更新tor ip
import repr as reprlib
import socket
import sys
try:
tor_c = socket.create_connection(("127.0.0.1", 9151))
tor_c.send('AUTHENTICATE "{}"\r\n'.format("16:D14CC89AD7848B8C60093105E8284A2D3AB2CF3C20D95FECA0848CFAD2"))
response = tor_c.recv(1024)
if response != '250 OK\r\n250 OK\r\n':
sys.stderr.write('Unexpected response from Tor control port: {}\n'.format(response))
except Exception, e:
sys.stderr.write('Error connecting to Tor control port: {}\n'.format(repr(e)))
但是服务器总是回答我从Tor的控制端口
意外的响应:515验证失败:密码不匹配HashedControlPassword 或 身份验证cookie。
我知道有这类任务的Python库,但我想重申只蟒蛇的标准套接字库的IP,我怎么能这样正常吗?谢谢
谢谢,问题是密码,我不应该输入哈希,但实际的密码,我是多么愚蠢。 – StereoMatching