Skip to content

Instantly share code, notes, and snippets.

@c0ldlimit
Forked from ehmo/gist:1349819
Created April 2, 2013 03:16
Show Gist options
  • Save c0ldlimit/5289645 to your computer and use it in GitHub Desktop.
Save c0ldlimit/5289645 to your computer and use it in GitHub Desktop.
def NewTorIP():
s = socket.socket()
s.connect(('localhost', 9051))
s.send("AUTHENTICATE\r\n")
r = s.recv(1024)
if r.startswith('250'):
s.send("signal NEWNYM\r\n")
r = s.recv(1024)
if r.startswith('250'):
return True
else:
return False
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment