-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtor_ip_changer2.py
58 lines (49 loc) · 1.5 KB
/
tor_ip_changer2.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
import os
import sys
import json
import time
import requests
import urllib.request
def get_current_ip():
session = requests.session()
session.proxies = {}
session.proxies['http']='socks5://localhost:9050'
session.proxies['https']='socks5://localhost:9050'
try:
r = session.get('http://ifconfig.me/ip')
except Exception as e:
print (e)
else:
return r.text
if __name__ == "__main__":
for i in range(1):
os.system("clear")
print(" ### TOR-IP-CHANGER2 ### ")
time.sleep(1)
print(" #### Author : Rahat Khan Tusar(RKT) ####")
time.sleep(2)
print(" ###### Github : https://github.com/r3k4t ######")
print
time.sleep(2)
print ("Old Idenity")
time.sleep(2)
print (get_current_ip())
time.sleep(2)
url = "http://ip-api.com/json/"
response = urllib.request.urlopen(url + get_current_ip() )
data = response.read()
rkt = json.loads(data)
print (data)
os.system("sudo service tor restart")
time.sleep(2)
print ("New Idenity")
time.sleep(2)
print (get_current_ip())
time.sleep(2)
url = "http://ip-api.com/json/"
response = urllib.request.urlopen(url + get_current_ip() )
data = response.read()
rkt = json.loads(data)
print (data)
print ("Check tor connection")
print ("Link:http://check.torproject.org")