Copy the hash and save it in the config file. Restart Vidalia.
Taken this code from Moshe Basanchig, I've written this code wich authenticates against TOR:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def renewTorIdentity(self, passAuth): | |
try: | |
s = socket.socket() | |
s.connect(('localhost', 9051)) | |
s.send('AUTHENTICATE "{0}"\r\n'.format(passAuth)) | |
resp = s.recv(1024) | |
if resp.startswith('250'): | |
s.send("signal NEWNYM\r\n") | |
resp = s.recv(1024) | |
if resp.startswith('250'): | |
print "Identity renewed" | |
else: | |
print "response 2:", resp | |
else: | |
print "response 1:", resp | |
except Exception as e: | |
print "Can't renew identity: ", e |
Be careful, you should pass to the function the password you created the hash for, not the hashed string!. Also check out this book, it is a good and fast read:
1 comment:
posted as response @stackoverflow
http://stackoverflow.com/a/11525609/1216184
Post a Comment