-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautoTOR.py
More file actions
93 lines (78 loc) · 2.72 KB
/
autoTOR.py
File metadata and controls
93 lines (78 loc) · 2.72 KB
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
import time
import os
import subprocess
import requests
def install_package(package_name):
try:
check_package = subprocess.check_output(f"dpkg -s {package_name}", shell=True)
if "install ok installed" in str(check_package):
return
except subprocess.CalledProcessError:
print(f"[+] {package_name} not installed")
subprocess.check_output("sudo apt update", shell=True)
subprocess.check_output(f"sudo apt install {package_name} -y", shell=True)
print(f"[!] {package_name} installed successfully")
def install_python_package(package_name):
try:
__import__(package_name)
except ImportError:
print(f"[+] python3 {package_name} is not installed")
os.system(f"sudo pip3 install {package_name}")
print(f"[!] python3 {package_name} is installed")
def ma_ip():
url = "https://www.myexternalip.com/raw"
get_ip = requests.get(
url,
proxies=dict(http="socks5://127.0.0.1:9050", https="socks5://127.0.0.1:9050"),
)
return get_ip.text
def change():
if not os.path.exists('/run/tor'):
try:
os.makedirs('/run/tor', mode=0o755)
os.chown('/run/tor', uid=116, gid=126)
except Exception as e:
print(f"Failed to create '/run/tor' directory: {e}")
return
os.system("sudo service tor reload")
print("[+] Your IP has been Changed to : " + str(ma_ip()))
def main():
install_package("python3-pip")
install_python_package("requests")
install_package("tor")
os.system("clear")
print(
"""\033[1;32;40m \n
_ _______
/\ | | |__ __|
/ \ _ _| |_ ___ | | ___ _ __
/ /\ \| | | | __/ _ \ | |/ _ \| '__|
/ ____ \ |_| | || (_) | | | (_) | |
/_/ \_\__,_|\__\___/ |_|\___/|_|
V 2.1
from Dev-Yoko
"""
)
print("\033[1;40;31m http://facebook.com/ninja.hackerz.kurdish/\n")
os.system("sudo service tor start")
time.sleep(3)
print("\033[1;32;40m change your SOCKS to 127.0.0.1:9050 \n")
try:
x = int(input("[+] time to change IP in seconds [type=60] >> "))
lin = int(input("[+] how many times do you want to change your IP [type=1000], for infinite IP changes type [0] >>"))
except ValueError:
print("[!] Invalid input. Please enter valid numbers.")
return
try:
if lin == 0:
while True:
time.sleep(x)
change()
else:
for i in range(lin):
time.sleep(x)
change()
except KeyboardInterrupt:
print("\nauto tor is closed ")
if __name__ == "__main__":
main()