File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
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 \n SIGNAL NEWNYM\r \n ' .format (PWD ))
11
+ response = tor_c .recv (1024 )
12
+ if response != '250 OK\r \n 250 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
+
Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ def get_args():
120
120
action = "store_true" ,
121
121
help = ' ' .join (("Info displays basic info of the" ,
122
122
"scanned site, (very slow)" )))
123
+ parser .add_argument ("" - r", " - - random " ,
124
+ action = "store_true" ,
125
+ help = ' ' .join (("Randomize tor identity for every 5 request" )))
123
126
return parser .parse_args ()
124
127
125
128
You can’t perform that action at this time.
0 commit comments