-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
70 lines (63 loc) · 1.88 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import time
import threading
import os
import requests
def exit_():
result=input("\n( ? ) are you sure you want to exit? (YES-NO) > ")
if result.lower() =="yes" or result.lower()=="y":
print("\n( ! ) exit ( ! ) ")
exit(1)
elif result.lower() =="no" or result.lower()=="n":
os.system("clear")
else:
print("\n( ! ) Error uknown respones, ignore ( ! ) ")
tor_sleep(times,sleep)
def get_tor_session():
session = requests.session()
session.proxies = {'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'}
return session
def tor_sleep(times,sleep):
try:
i=1
for i in range(times):
os.system("clear")
print("( i ) ip change times --> {}\n".format(i))
print("( i ) sleep is --> {}\n".format(sleep))
print("( i ) orginal times --> {}".format(times))
time.sleep(sleep)
os.system("service tor status")
print("\n( i ) restarting...")
os.system("service tor restart")
time.sleep(2)
session = get_tor_session()
print("\nTor ip:")
print(session.get("http://httpbin.org/ip").text)
print("\nPublic ip:")
print(requests.get("http://httpbin.org/ip").text)
time.sleep(4)
print("( ! ) done!\ntimes --> {}".format(times))
except KeyboardInterrupt:
exit_()
def change(times,sleep):
times=int(times)
sleep=int(sleep)
try:
tor_sleep(times,sleep)
except KeyboardInterrupt:
exit_()
def startup():
try:
print("@StomrTools simple Tor ip changer\n make sure you have service tor installed on your linux machine\n")
times=input("times (default is 10000) > ") or 10000
sleep=input("sleep (default is 1min) > ") or "60"
print("( * ) times set to ---> {}".format(times)+"\n")
if sleep:
sleep = str(sleep)
print("( * ) sleep set to ---> {}".format(sleep)+"\n")
print("( * ) starting...\n")
change(times,sleep)
except KeyboardInterrupt as e:
exit_()
if __name__=="__main__":
startup()