-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
46 lines (37 loc) · 1.09 KB
/
setup.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
import os
import shutil
import sys
if os.getuid() == 1:
print("AVVIA QUESTO SCRIPT DA AMMINISTRATORE")
sys.exit()
if "gmitm.py" not in os.listdir() and "main.py" not in os.listdir():
print("impossibile trovare i file necessari per l'installazione(questo script è dentro la repo?)")
sys.exit()
os.system("apt get install pip")
os.system("pip install scapy")
try:
os.mkdir("/gmitm")
except:
print("CARTELLA /gmitm GIA ESISTENTE!!!!!\nDESIDERI SOVRASCRIVERE?")
i = input("('y' or 'n')>. ")
if i == "y":
os.system("rm -r /gmitm")
else:
sys.exit()
shutil.move("gmitm.py", "/gmitm/gmitm.py")
shutil.move("main.py", "/gmitm/main.py")
file = open("/etc/systemd/system/gmitm.service", "w")
file.write("""[Unit]
Description=iface sniff service
Before=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/gmitm
ExecStart=python /gmitm/main.py
[Install]
WantedBy=multi-user.target""")
file.close()
os.system("systemctl daemon-reload")
os.system("systemctl enable gmitm.service")
print("INSTALLAZIONE COMPLETATA")