-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
128 lines (115 loc) · 4.94 KB
/
main.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
import watchers.windowsdefender as WindowsDefender
import watchers.windowsfirewall as WindowsFirewall
import watchers.powershell as PowerShell
import watchers.openssh as OpenSSH
import os, sys, time
import threading
from term_image.image import from_file
def clear():
if os.name == "nt":
os.system("cls")
else:
os.system("clear")
watching_config = {
"WindowsDefender": False,
"WindowsFirewall": False,
"PowerShell": False,
"OpenSSH": False
}
class colors:
darkred = "\033[31m"
red = "\033[91m"
lightred = "\033[38;5;196m"
darkgreen = "\033[32m"
green = "\033[92m"
lightgreen = "\033[38;5;46m"
darkyellow = "\033[33m"
yellow = "\033[93m"
lightyellow = "\033[38;5;226m"
darkblue = "\033[34m"
blue = "\033[94m"
lightblue = "\033[38;5;21m"
reset = "\033[0m"
fire = "\033[38;5;196m"
bold = "\033[1m"
banner = f"""{colors.blue}{colors.bold}
....::::::::::::::....
...:::::::::........:::::::::::...
..:::::::::.. ..:::::::::::..
..::::::::::. ........ ..:::::::::::..
.::::::::::::. ..:::::::::.. .::::::::::::..
.::::::::::::::. ::::::::::. .::::::::::::::.
.::::::::::::::::. :::::::::: .:::::::::::::::..
.:::::::::::::::::. ::::::::::: ::::::::::::::::::.
.:::::::::::::::::::. :::::::::::. .:::::::::::::::::::.
.::::::::::::::::::::. .::::::::::::.. .. .:::::::::::::::::::.
.:::::::::::::::::. :::::::::::::::::::: ::::::::::::::::::.
.:::::::::::::::: .::::::::::::::::. .:::::::::::::::..
..::::::::::::::. ..::::::::::.. .::::::::::::::.
..::::::::::::. .... .::::::::::::..
..:::::::::::. .:::::::::::..
..::::::::::.. ..::::::::::..
...::::::::::........::::::::::...
....::::::::::::::....
{colors.reset}{colors.red}
"The all seeing eye." - LogSentry
{colors.reset}"""
def mon(key):
print(f"\n{colors.green}Starting {key} watcher...{colors.reset}")
while True:
try:
if key == "WindowsDefender":
WindowsDefender.Watch()
elif key == "WindowsFirewall":
WindowsFirewall.Watch()
elif key == "PowerShell":
PowerShell.Watch()
elif key == "OpenSSH":
OpenSSH.Watch()
else:
print(f"{colors.red}Invalid watcher!{colors.reset}")
break
except KeyboardInterrupt:
print(f"{colors.red}{key} watcher was stopped!{colors.reset}")
break
time.sleep(3)
def main():
divider = "-" * 20
while True:
clear()
for char in banner:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(0.0001)
print(colors.blue + "\n\n" + divider + " | LogSentry Watching | " + divider + colors.reset)
print(f"{colors.blue}1. Windows Defender: " + str(watching_config["WindowsDefender"]) + f"{colors.reset}")
print(f"{colors.blue}2. Windows Firewall: " + str(watching_config["WindowsFirewall"]) + f"{colors.reset}")
print(f"{colors.blue}3. PowerShell: " + str(watching_config["PowerShell"]) + f"{colors.reset}")
print(f"{colors.blue}4. Start OpenSSH: " + str(watching_config["PowerShell"]) + f"{colors.reset}")
print(f"{colors.blue}5. Start LogSentry{colors.reset}")
choice = input("\nEnter your choice: ")
if choice == "1":
watching_config["WindowsDefender"] = not watching_config["WindowsDefender"]
elif choice == "2":
watching_config["WindowsFirewall"] = not watching_config["WindowsFirewall"]
elif choice == "3":
watching_config["PowerShell"] = not watching_config["PowerShell"]
elif choice == "4":
watching_config["OpenSSH"] = not watching_config["OpenSSH"]
elif choice == "5":
threads = []
for key,value in watching_config.items():
if value == True:
thread = threading.Thread(target=mon, args=(key,))
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
else:
print("Invalid choice. Please try again.")
print("\"You aint built for these seas cuh\" - Monkey Pirate")
image = from_file("monkeyseas.png")
print(image)
time.sleep(3)
if __name__ == "__main__":
main()