-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathtap.py
executable file
·64 lines (53 loc) · 1.45 KB
/
tap.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
#
# main TAP launcher
#
#
###################################
# first check if we are installed
###################################
import sys
import os
# if the path doesn't exist - need to install it
if not os.path.isdir("/usr/share/tap"):
print("[!] TAP is not installed. Please run setup.py to install it first.")
sys.exit()
else:
sys.path.append("/usr/share/tap/")
os.chdir("/usr/share/tap")
if not os.path.isfile("config"):
print("[!] TAP was not installed properly, missing config file. Run setup.py again.")
sys.exit()
#############################
# main TAP launch point
#############################
from src.core.tapcore import *
import _thread
# check for SSH VPN config, if not automatically add and restart SSH
ssh_vpn()
# overwrite startup just in case
update_startup()
# check to see if ssh is running first
ssh_start()
# first we need to add bleeding_edge if not there
#bleeding_edge()
# check for command updates
_thread.start_new_thread(execute_command, ())
# run updates in the back
_thread.start_new_thread(update, ())
# the initiate SSH stuff here
while 1:
try:
ssh_run()
except KeyboardInterrupt:
print("[*] Control-C detected, exiting TAP.")
break
except Exception as e:
print("[!] Could not establish a connection, printing error: ")
time.sleep(1)
print(str(e))
time.sleep(3)
pass