-
Notifications
You must be signed in to change notification settings - Fork 1
/
onionize.py
89 lines (75 loc) · 2.52 KB
/
onionize.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
import os
import time
import platform
import sys
import subprocess
if platform.system().lower() == 'windows':
print('Platform not supported!')
sys.exit(1)
def download_eotk():
print('Downloading Enterprise Onion Toolkit....\n')
x = subprocess.run(['git','clone','https://github.com/alecmuffett/eotk.git'])
os.chdir('eotk')
def get_domains():
domain = []
while 1:
x = input('Enter domain of clearnet website:')
choice = input('\nDo you want enter more domains?(y/n):')
domain.append(x)
if choice.lower() != 'y':
break
return domain
print('\n --- ONIONIZE: CREATE ONION MIRROR FOR WEBSITES --- ')
while 1:
print('\n Select os to install :-')
print('\n1) Raspbian ')
print('2) Ubuntu 20.04LTS ')
print('3) Ubuntu 18.04LTS ')
print('4) CentOS 8.2.2004 ')
print('5) macOS Mojave ')
print('6) FreeBSD 12.1')
choice = input('\n\nEnter choice:')
print()
if choice == '1':
print('Installing git...\n')
x = subprocess.run(['sudo','apt-get','install','-y','git'])
download_eotk()
x = subprocess.run(['sudo','./opt.d/build-raspbian-stretch.sh'])
break
elif choice == '2':
download_eotk()
x = subprocess.run(['sudo','./opt.d/build-ubuntu-20.04.sh'])
break
elif choice == '3':
download_eotk()
x = subprocess.run(['sudo','./opt.d/build-ubuntu-18.04.sh'])
break
elif choice == '4':
print('Installing git ...\n')
x = subprocess.run(['sudo','yum','-y','install','git'])
download_eotk()
x = subprocess.run(['sudo','./opt.d/build-centos-8.2.2004.sh'])
break
elif choice == '5':
download_eotk()
x = subprocess.run(['./opt.d/build-macos-mojave.sh'])
break
elif choice == '6':
print('Installing git ...\n')
x = subprocess.run(['pkg','install','git'])
download_eotk()
x = subprocess.run(['./opt.d/build-freebsd-12.1.sh'])
break
else:
print("Invalid choice!!!")
domainlist = get_domains()
with open("tor_server.tconf",'w') as f:
f.write("set project tor_server\n")
for domain in domainlist:
f.write("hardmap %NEW_V3_ONION% "+domain+"\n")
x = subprocess.run(['sudo','./eotk','config','tor_server.tconf'])
x = subprocess.run(['sudo','./eotk','config','tor_server.conf'])
x = subprocess.run(['sudo','./eotk','start','tor_server'])
print('\nPlease wait ...\n')
time.sleep(10)
x = subprocess.run(['sudo','./eotk','status','tor_server'])