-
Notifications
You must be signed in to change notification settings - Fork 7
/
ToriFY.py
375 lines (313 loc) · 14.1 KB
/
ToriFY.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
#!/usr/bin/python3
import os
import sys
import json
import time
import requests
import random
from requests import get, session
from sys import exit
from time import sleep
from macvendors import *
import uuid
try:
from colorizor import *
except ImportError as ier:
print(ier)
if os.geteuid() != 0:
print(COLOR.RED + "[-] This tool must be run as root. Please run it with sudo or as root user.")
sys.exit(1)
os.system('clear')
def show_options():
print(COLOR.BRIGHT_BLUE + '[1] ' + COLOR.WHITE + 'hide my ip once')
print(COLOR.BRIGHT_BLUE + '[2] ' + COLOR.WHITE + 'hide my ip repeatedly')
print(COLOR.BRIGHT_BLUE + '[3] ' + COLOR.WHITE + 'change ip')
print(COLOR.BRIGHT_BLUE + '[4] ' + COLOR.WHITE + 'change my mac address')
print(COLOR.BRIGHT_BLUE + '[5] ' + COLOR.WHITE + 'do it all')
print(COLOR.BRIGHT_BLUE + '[6] ' + COLOR.WHITE + 'show ip')
print(COLOR.BRIGHT_BLUE + '[7] ' + COLOR.WHITE + 'stop')
print(COLOR.BRIGHT_BLUE + '[8] ' + COLOR.WHITE + 'clear')
print(COLOR.BRIGHT_BLUE + '[9] ' + COLOR.WHITE + 'exit/quit\n')
def show_mac_options():
print(COLOR.BRIGHT_BLUE + '[1] ' + COLOR.WHITE + ' [ Full Random MAC Address ]')
print(COLOR.BRIGHT_BLUE + '[2] ' + COLOR.WHITE + ' [ Samsung ]')
print(COLOR.BRIGHT_BLUE + '[3] ' + COLOR.WHITE + ' [ Apple ]')
print(COLOR.BRIGHT_BLUE + '[4] ' + COLOR.WHITE + ' [ HUAWEI ]')
print(COLOR.BRIGHT_BLUE + '[5] ' + COLOR.WHITE + ' [ Nokia ]')
print(COLOR.BRIGHT_BLUE + '[6] ' + COLOR.WHITE + ' [ BlackBerry ]')
print(COLOR.BRIGHT_BLUE + '[7] ' + COLOR.WHITE + ' [ Motorola ]')
print(COLOR.BRIGHT_BLUE + '[8] ' + COLOR.WHITE + ' [ HTC ]')
print(COLOR.BRIGHT_BLUE + '[9] ' + COLOR.WHITE + ' [ Google ]')
print(COLOR.BRIGHT_BLUE + '[10] ' + COLOR.WHITE + '[ ASUS ]')
print(COLOR.BRIGHT_BLUE + '[11] ' + COLOR.WHITE + '[ FUJITSU ]')
print(COLOR.BRIGHT_BLUE + '[12] ' + COLOR.WHITE + '[ TOSHIBA ]')
print(COLOR.BRIGHT_BLUE + '[13] ' + COLOR.WHITE + '[ Acer ]')
print(COLOR.BRIGHT_BLUE + '[14] ' + COLOR.WHITE + '[ Dell ]')
print(COLOR.BRIGHT_BLUE + '[15] ' + COLOR.WHITE + '[ HP ]\n')
print(COLOR.BRIGHT_BLUE + '[S] ' + COLOR.WHITE + 'Show MAC Adress')
print(COLOR.BRIGHT_BLUE + '[B] ' + COLOR.WHITE + 'Back to the main options')
print(COLOR.BRIGHT_BLUE + '[X] ' + COLOR.WHITE + 'exit/quit\n')
def banner():
print(COLOR.RED + """
███████████ ███ ███████████ █████ █████
░█░░░███░░░█ ░░░ ░░███░░░░░░█░░███ ░░███
░ ░███ ░ ██████ ████████ ████ ░███ █ ░ ░░███ ███
░███ ███░░███░░███░░███░░███ ░███████ ░░█████
░███ ░███ ░███ ░███ ░░░ ░███ ░███░░░█ ░░███
░███ ░███ ░███ ░███ ░███ ░███ ░ ░███
█████ ░░██████ █████ █████ █████ █████
░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
author : Debajyoti0-0
version: 2.0
Github : https://github.com/Debajyoti0-0/
""")
banner()
show_options()
def get_mac():
try:
mac = open('/sys/class/net/'+"eth0"+'/address').readline()
print (COLOR.BRIGHT_BLUE + "[#] Your New MACADDRESS is : ", mac + COLOR.WHITE)
except:
mac = "00:00:00:00:00:00"
import random
USER_AGENTS = [
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15'
]
def show_ip():
try:
headers = {
'User-Agent': random.choice(USER_AGENTS)
}
getr = get('http://ip-api.com/json/', headers=headers)
if getr.status_code == 200:
getj = getr.json()
print(COLOR.LIGHT_CYAN + '[#] Full Information: ' + COLOR.WHITE + str(getj))
if 'query' in getj:
print(COLOR.LIGHT_CYAN + '[#] ' + COLOR.LIGHT_GRAY + 'IP : ' + COLOR.RED + getj['query'])
if 'country' in getj:
print(COLOR.LIGHT_CYAN + '[#] ' + COLOR.LIGHT_GRAY + 'COUNTRY : ' + COLOR.RED + getj['country'])
if 'city' in getj:
print(COLOR.LIGHT_CYAN + '[#] ' + COLOR.LIGHT_GRAY + 'CITY : ' + COLOR.RED + getj['city'])
else:
print(COLOR.LIGHT_CYAN + '[#] ' + COLOR.LIGHT_GRAY + 'CITY : ' + COLOR.WHITE + 'UNKNOWN')
else:
print(COLOR.RED + '[-] Failed to retrieve IP information. Status Code:', getr.status_code)
except Exception as e:
print(COLOR.RED + '[-] Error: Unable to retrieve IP information. Please check your internet connection.')
print(COLOR.RED + '[-] Exception:', str(e))
def start_anonsurf():
print(COLOR.LIGHT_GREEN + '\n[*] ' + COLOR.WHITE + 'Changing IP Address..')
os.system("sudo service tor stop")
#print(COLOR.LIGHT_GREEN + '[*] Stopping TOR service...')
time.sleep(5) # Wait for 5 seconds
os.system("sudo service tor start")
#print(COLOR.LIGHT_GREEN + '[*] Starting TOR service...')
time.sleep(5) # Wait for 5 seconds
os.system('anonsurf start >/dev/null 2>&1')
print(COLOR.LIGHT_GREEN + '[+] Changed Successfully!\n'+ COLOR.WHITE)
def change_ip_repeatedly():
try:
ip_change_delay = int(input(COLOR.YELLOW + '\n[?] ' + COLOR.WHITE + 'Change my IP Every '+COLOR.LIGHT_RED + '[SECONDS]' + COLOR.WHITE + ' : '))
if(ip_change_delay == 0):
print(COLOR.RED + '[-] Please Enter a Correct Number!' + COLOR.WHITE)
sleep(2)
os.system('clear')
banner()
show_options()
Engine()
print(COLOR.LIGHT_GREEN + '[*] ' + COLOR.WHITE + 'Running IP Changer Service..')
os.system('anonsurf start >/dev/null 2>&1')
print(COLOR.LIGHT_GREEN + '[+] Successfully Run!')
print(COLOR.LIGHT_CYAN + '\n[*] ' + COLOR.WHITE + 'Changing IP Every' + COLOR.LIGHT_RED + ' {}S '.format(ip_change_delay) + '\n')
print(COLOR.DARK_GRAY + '- - - - - - - - - - - - - - - - - -')
try:
while True:
sleep(ip_change_delay - 1)
os.system("sudo service tor stop")
#print(COLOR.LIGHT_GREEN + '[*] Stopping TOR service...')
time.sleep(5)
os.system("sudo service tor start")
#print(COLOR.LIGHT_GREEN + '[*] Starting TOR service...')
time.sleep(5)
os.system('anonsurf change ip >/dev/null 2>&1')
show_ip()
print(COLOR.DARK_GRAY + '- - - - - - - - - - - - - - - - - -')
except KeyboardInterrupt:
os.system('clear')
banner()
show_options()
Engine()
except ValueError:
print(COLOR.RED + '[-] Please Enter a Correct Number!' + COLOR.WHITE)
sleep(2)
os.system('clear')
banner()
show_options()
Engine()
def stop():
os.system('anonsurf stop >/dev/null 2>&1')
print(COLOR.LIGHT_GREEN + '[+] Successfully Stopped Anonsurf!\n' + COLOR.WHITE)
os.system('sudo service tor stop')
print(COLOR.LIGHT_GREEN + '[+] Successfully Stopped TOR!\n' + COLOR.WHITE)
print(COLOR.LIGHT_GREEN + '[*] Restarting NetworkManager...\n' + COLOR.WHITE)
if os.system('sudo systemctl restart NetworkManager') != 0:
print(COLOR.RED + '[-] Failed to restart NetworkManager. Trying to flush DNS manually.\n' + COLOR.WHITE)
if os.system('sudo service dnsmasq restart') != 0:
print(COLOR.RED + '[-] Failed to restart dnsmasq. Check your DNS settings manually.\n' + COLOR.WHITE)
def change_macaddress():
print(COLOR.LIGHT_GREEN + '\n[*] ' + COLOR.WHITE + 'Running MACCHANGER Service..')
eth = os.listdir('/sys/class/net/')
if 'eth0' in eth:
os.system('macchanger eth0 -r >/dev/null 2>&1')
elif 'wlan0' in eth:
os.system('macchanger wlan0 -r >/dev/null 2>&1')
else:
print(COLOR.RED + '[-] Could not Grab the Network Interface \n'+ COLOR.WHITE)
interface = input(COLOR.LIGHT_CYAN + '[?] Please Enter Your Network Interface Name : \n')
os.system('macchanger {} -r >/dev/null 2>&1'.format(interface))
print(COLOR.LIGHT_GREEN + '[+] Mac Address Changed Successfully!\n'+ COLOR.WHITE)
def goodbye():
print(COLOR.VIOLET + '\n[!] Thanks For Using ToriFY! Goodbye Buddy;)\n')
exit()
def MAC():
try:
while True:
choice = input(COLOR.GREEN + STYLE.ITALIC + '[cmd]~[mac]' + COLOR.WHITE + ' > ' + COLOR.WHITE)
if(choice == '1'):
print('\n')
change_macaddress()
get_mac()
elif(choice == '2'):
print('\n')
mac_samsung()
get_mac()
elif(choice == '3'):
print('\n')
mac_apple()
get_mac()
elif(choice == '4'):
print('\n')
mac_huawei()
get_mac()
elif(choice == '5'):
print('\n')
mac_nokia()
get_mac()
elif(choice == '6'):
print('\n')
mac_blackberry()
get_mac()
elif(choice == '7'):
print('\n')
mac_motorola()
get_mac()
elif(choice == '8'):
print('\n')
mac_htc()
get_mac()
elif(choice == '9'):
print('\n')
mac_google()
get_mac()
elif(choice == '10'):
print('\n')
mac_asus()
get_mac()
elif(choice == '11'):
print('\n')
mac_FUJITSU()
get_mac()
elif(choice == '12'):
print('\n')
mac_toshiba()
get_mac()
elif(choice == '13'):
print('\n')
mac_acer()
get_mac()
elif(choice == '14'):
print('\n')
mac_dell()
get_mac()
elif(choice == '15'):
print('\n')
mac_hp()
get_mac()
elif(choice == 's' or choice == 'S' or choice == 'mac' or choice == 'show mac'):
print('')
get_mac()
elif(choice == 'b' or choice == 'B' or choice == 'back'):
clear()
Engine()
elif(choice == 'X' or choice == 'x' or choice == 'exit' or choice == 'quit'):
os.system("clear")
goodbye()
else:
print(COLOR.RED + '[-] Wrong Command!' + COLOR.WHITE)
sleep(2)
os.system("clear")
banner()
show_mac_options()
except KeyboardInterrupt:
print('\n')
os.system("clear")
banner()
goodbye()
def clear():
os.system('clear')
banner()
show_options()
def Engine():
try:
while True:
choice = input(COLOR.GREEN + STYLE.ITALIC + '[cmd]' + COLOR.WHITE + ' > ' + COLOR.WHITE)
if(choice == '1' or choice.lower() == 'hide my ip once'):
start_anonsurf()
elif(choice == '2' or choice.lower() == 'hide my ip repeatedly'):
change_ip_repeatedly()
if(KeyboardInterrupt):
goodbye()
elif(choice == '3' or choice.lower() == 'change ip'):
os.system('anonsurf start >/dev/null 2>&1')
os.system('anonsurf change ip >/dev/null 2>&1')
print(COLOR.LIGHT_GREEN + '\n[+] Successfully Changed!\n'+ COLOR.WHITE)
show_ip()
print('\n')
elif(choice == '4' or choice.lower() == 'change my mac address'):
os.system('clear')
banner()
show_mac_options()
MAC()
elif(choice == '5' or choice.lower() == 'do it all'):
start_anonsurf()
os.system('anonsurf change ip >/dev/null 2>&1')
show_ip()
change_macaddress()
get_mac()
elif(choice == '6' or choice.lower() == 'show ip'):
print('\n')
show_ip()
print('\n')
elif(choice == '7' or choice.lower() == 'stop'):
stop()
elif(choice == '8' or choice.lower() == 'clear'):
clear()
elif(choice == '9'or choice.lower() == 'quit' or choice.lower() == 'exit'):
os.system("clear")
banner()
goodbye()
else:
print(COLOR.RED + '[-] Wrong Command!' + COLOR.WHITE)
sleep(2)
clear()
except KeyboardInterrupt:
print('\n')
os.system("clear")
banner()
goodbye()
Engine()