-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
145 lines (121 loc) · 4.63 KB
/
Copy pathmain.py
File metadata and controls
145 lines (121 loc) · 4.63 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import os
import time
import importlib
import shutil
# Import OS detection module
from modules.os_detect import detect_environment
# ANSI colors
CYAN = "\033[36m"
RED = "\033[31m"
GREEN = "\033[32m"
RESET = "\033[0m"
ASCII_ART = r"""
╭──────────────────────────╮
│ ╭─╮ ╭─╮╭──────╮╭─────╮ │
│ │ ╰╮ ╭╯ ││ ╭──╮ │╰─╮ ╭─╯ │
│ │ ╰─╯ ││ ╰──╯ │ │ │ │
│ │ ╭╮ ╭╮ ││ ╭──╮ │ │ │ │
│ │ │╰─╯│ ││ │ │ │ │ │ │
│ ╰─╯ ╰─╯╰─╯ ╰─╯ ╰─╯ │
│ ╭──────╮ ╭─────╮ ╭─╮ ╭─╮ │
│ │ ╭──╮ │ ╰─╮ ╭─╯ │ │ │ │ │
│ │ ╰──╯╭╯ │ │ ╰╮╰─╯╭╯ │
│ │ ╭──╮╰╮ │ │ ╭╯╭─╮╰╮ │
│ │ │ │ │ ╭─╯ ╰─╮ │ │ │ │ │
│ ╰─╯ ╰─╯ ╰─────╯ ╰─╯ ╰─╯ │
╰──────────────────────────╯
╭──────────────────────────╮
│ MATRIX SCANNER V1 │
╰──────────────────────────╯
"""
DISCLAIMER_TEXT = r"""
╭──────────────────────────╮
│ This tool is intended │
│ for authorized security │
│ testing, research, and │
│ educational use. │
│ Unauthorized access to │
│ systems you do not own │
│ or have explicit │
│ permission to test is │
│ illegal. │
│ │
│ By continuing, you │
│ acknowledge full │
│ responsibility for your │
│ actions. │
╰──────────────────────────╯
"""
def clear():
os.system("cls" if os.name == "nt" else "clear")
def center_block(text):
width = shutil.get_terminal_size().columns
return "\n".join(line.center(width) for line in text.splitlines())
def boot_sequence():
clear()
print(GREEN + center_block(ASCII_ART) + RESET)
time.sleep(3)
clear()
print(RED + center_block(DISCLAIMER_TEXT) + RESET)
time.sleep(4)
clear()
def load_module(module_name):
try:
module = importlib.import_module(f"modules.{module_name}")
return module
except ImportError:
print(f"{RED}Module '{module_name}' not found.{RESET}")
return None
def main_menu(env):
while True:
print(center_block(f"{GREEN}╭──────────────────────────╮{RESET}"))
print(center_block(f"{GREEN} │{RESET} MATRIX SCANNER MENU {GREEN}│{RESET}"))
print(center_block(f"{GREEN}╰──────────────────────────╯{RESET}"))
print()
print("1) Run Full Scan")
print("2) Run Specific Module")
print("3) Show Environment Info")
print("4) Exit")
print()
choice = input("Select an option: ").strip()
if choice == "1":
run_full_scan(env)
elif choice == "2":
run_specific_module(env)
elif choice == "3":
print("\nDetected Environment:")
print(env)
print()
elif choice == "4":
print("Exiting...")
break
else:
print("Invalid choice.\n")
def run_full_scan(env):
print("\nRunning full scan...\n")
# Automatically load all modules except os_detect
module_dir = "modules"
for file in os.listdir(module_dir):
if file.endswith(".py") and file not in ["__init__.py", "os_detect.py"]:
module_name = file[:-3]
module = load_module(module_name)
if module:
if hasattr(module, "run"):
print(f"Running module: {module_name}")
module.run(env)
else:
print(f"Module '{module_name}' has no run() function.")
print("\nFull scan complete.\n")
def run_specific_module(env):
module_name = input("Enter module name: ").strip()
module = load_module(module_name)
if module and hasattr(module, "run"):
module.run(env)
else:
print("Invalid module or missing run() function.\n")
def main():
boot_sequence()
env = detect_environment()
main_menu(env)
if __name__ == "__main__":
main()