Skip to content

Commit 369fa34

Browse files
committed
Randomizer Patch #1
1 parent 0fe0d58 commit 369fa34

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

modules/randomizer.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Module for randomizing tor identity
3+
"""
4+
import socket
5+
6+
def randomize_IP(HOST, PORT, PWD):
7+
8+
try:
9+
tor_c = socket.create_connection((HOST, PORT))
10+
tor_c.send('AUTHENTICATE "{}"\r\nSIGNAL NEWNYM\r\n'.format(PWD))
11+
response = tor_c.recv(1024)
12+
if response != '250 OK\r\n250 OK\r\n':
13+
sys.stderr.write('Unexpected response from Tor control port: {}\n'.format(response))
14+
except Exception, e:
15+
sys.stderr.write('Error connecting to Tor control port: {}\n'.format(repr(e)))
16+
17+
18+
19+
#def randomize_header():
20+
21+
22+

torBot.py

+3
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ def get_args():
120120
action="store_true",
121121
help=' '.join(("Info displays basic info of the",
122122
"scanned site, (very slow)")))
123+
parser.add_argument(""-r", "--random",
124+
action="store_true",
125+
help=' '.join(("Randomize tor identity for every 5 request")))
123126
return parser.parse_args()
124127

125128

0 commit comments

Comments
 (0)