-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinjectsuite.py
More file actions
303 lines (226 loc) · 10.5 KB
/
injectsuite.py
File metadata and controls
303 lines (226 loc) · 10.5 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#!/usr/bin/env python3
"""
InjectSuite - Modular Injection Detection Toolkit
"""
import sys
import time
import importlib
from rich.console import Console
from rich.panel import Panel
from rich.prompt import Prompt
from rich.text import Text
from rich import box
console = Console()
ASCII_BANNER = r"""
/==========================================================================================\
| 01001001 01001110 01001010 01000101 01000011 01010100 01010011 01010101 01000101 |
| 01001001 01010100 01000101 01000001 01001101 01010011 01001001 01010100 01010100 |
| |
| ╔════════════════════════════════════════════════════════════════════════════════════╗ |
| ║██╗███╗ ██╗ ██╗███████╗ ██████╗████████╗███████╗██╗ ██╗██╗████████╗███████╗ ║ |
| ║██║████╗ ██║ ██║██╔════╝██╔════╝╚══██╔══╝██╔════╝██║ ██║██║╚══██╔══╝██╔════╝ ║ |
| ║██║██╔██╗ ██║ ██║█████╗ ██║ ██║ ███████╗██║ ██║██║ ██║ █████╗ ║ |
| ║██║██║╚██╗██║██ ██║██╔══╝ ██║ ██║ ╚════██║██║ ██║██║ ██║ ██╔══╝ ║ |
| ║██║██║ ╚████║╚█████╔╝███████╗╚██████╗ ██║ ███████║╚██████╔╝██║ ██║ ███████╗ ║ |
| ║╚═╝╚═╝ ╚═══╝ ╚════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝ ║ |
| ╚════════════════════════════════════════════════════════════════════════════════════╝ |
| |
| [BOOT] ┌─[ CORE ]─────────────────────────────────────────────────────────────────┐ |
| [INIT] │ • Payload Engine : ONLINE │ |
| [LOAD] │ • Reflection Probe : OK │ |
| [READY] │ • Vector Modules : SQLi | XSS | CMD │ |
| [SET] └──────────────────────────────────────────────────────────────────────────┘ |
| |
\==========================================================================================/
"""
# --------------------------------------------------
# Banner Coloring
# --------------------------------------------------
def colorize_banner(ascii_banner):
lines = []
for line in ascii_banner.splitlines():
text = Text(line)
if "0100" in line:
text.stylize("green")
elif "===" in line or "╔" in line or "╝" in line or "╚" in line:
text.stylize("bright_cyan")
elif "██" in line:
text.stylize("bold bright_cyan")
elif "[BOOT]" in line or "[INIT]" in line or "[LOAD]" in line or "[READY]" in line or "[SET]" in line:
text.stylize("bright_magenta")
else:
text.stylize("bright_cyan")
lines.append(text)
return lines
# --------------------------------------------------
# Banner
# --------------------------------------------------
def show_banner():
banner_lines = colorize_banner(ASCII_BANNER)
banner_text = Text()
for line in banner_lines:
banner_text.append(line)
banner_text.append("\n")
console.print(
Panel.fit(
banner_text,
border_style="bright_cyan",
title="[bold bright_magenta]INJECTSUITE[/bold bright_magenta]",
box=box.SQUARE
)
)
warning = Text.from_markup(
"[bright_yellow]This tool is intended for educational and authorized security testing only.[/bright_yellow]\n"
"[bright_red]⚠ Do NOT use this tool against live or unauthorized websites.[/bright_red]\n"
"[bright_blue]✔ Always test in controlled environments (DVWA, Juice Shop, TestFire).[/bright_blue]"
)
console.print(
Panel(
warning,
border_style="red",
title="[bold red]LEGAL NOTICE[/bold red]"
)
)
# --------------------------------------------------
# Boot Animation
# --------------------------------------------------
def matrix_boot():
total = 20
for i in range(total + 1):
percent = int((i / total) * 100)
filled = "█" * i
empty = "░" * (total - i)
console.print(
f"[green][BOOT][/green] [{filled}{empty}] {percent}%",
end="\r"
)
time.sleep(0.07)
console.print("\n[bold green]✔ System modules initialized[/bold green]\n")
# --------------------------------------------------
# Hacker typing animation
# --------------------------------------------------
def type_writer(text, speed=0.02):
for char in text:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(speed)
print()
def hacker_boot_messages():
messages = [
"> Initializing InjectSuite Core...",
"> Loading Payload Engine...",
"> Activating Reflection Probe...",
"> Registering SQL Injection Module...",
"> Registering XSS Module...",
"> Registering Command Injection Module...",
"> Modules Ready."
]
for msg in messages:
type_writer(msg)
time.sleep(0.3)
console.print("[bold green]✔ InjectSuite Ready[/bold green]\n")
# --------------------------------------------------
# Compact Header (used after first run)
# --------------------------------------------------
def show_compact_header():
title = "[bold magenta]INJECTSUITE[/bold magenta]"
subtitle = "[cyan]Modular Injection Detection Toolkit[/cyan]"
console.print(
Panel.fit(
Text.from_markup(f"{title}\n{subtitle}"),
border_style="bright_blue",
box=box.ROUNDED
)
)
# --------------------------------------------------
# Scan Configuration Panel
# --------------------------------------------------
def show_scan_config():
console.print(
Panel(
"[cyan]Target:[/cyan] http://testphp.vulnweb.com\n"
"[cyan]Mode:[/cyan] Active Scan\n"
"[cyan]Modules:[/cyan] SQLi | XSS | CMDi",
title="[bold green]Scan Configuration[/bold green]",
border_style="green"
)
)
# --------------------------------------------------
# Dynamic module loader
# --------------------------------------------------
def load_module(module_name, function_names):
try:
mod = importlib.import_module(module_name)
except ModuleNotFoundError:
console.print(f"[red]Module {module_name} not found[/red]")
return None
for name in function_names:
fn = getattr(mod, name, None)
if callable(fn):
return fn
console.print(f"[red]{module_name} does not expose expected functions[/red]")
return None
# --------------------------------------------------
# Main Menu
# --------------------------------------------------
def main_menu():
sql_runner = load_module("scanners.sqli_scanner", ["run_sql_injection_scanner", "main"])
xss_runner = load_module("scanners.xss_scanner", ["run_xss_scanner", "main"])
cmdi_runner = load_module("scanners.cmdi_scanner", ["run_cmdi_scanner", "main"])
first_run = True
while True:
console.clear()
if first_run:
matrix_boot()
hacker_boot_messages()
show_banner()
first_run = False
else:
show_compact_header()
console.print()
console.print(
Panel.fit(
"[bold cyan]Select an option[/bold cyan]\n\n"
"[1] Run SQL Injection Scanner\n"
"[2] Run XSS Scanner\n"
"[3] Run Command Injection Scanner\n"
"[4] Exit\n",
title="[bold magenta]Main Menu[/bold magenta]",
border_style="bright_blue"
)
)
choice = Prompt.ask(
"[green]Enter choice[/green]",
choices=["1", "2", "3", "4"],
default="1"
)
if choice == "1":
# show_scan_config()
if sql_runner:
console.print("[yellow]Launching SQL Injection Scanner...[/yellow]\n")
sql_runner()
else:
console.print("[red]SQL scanner module missing[/red]")
Prompt.ask("\nPress Enter to return")
elif choice == "2":
# show_scan_config()
if xss_runner:
console.print("[yellow]Launching XSS Scanner...[/yellow]\n")
xss_runner()
else:
console.print("[red]XSS scanner module missing[/red]")
Prompt.ask("\nPress Enter to return")
elif choice == "3":
# show_scan_config()
if cmdi_runner:
console.print("[yellow]Launching Command Injection Scanner...[/yellow]\n")
cmdi_runner()
else:
console.print("[red]CMDi scanner module missing[/red]")
Prompt.ask("\nPress Enter to return")
elif choice == "4":
console.print("\n[bold green]Goodbye — stay ethical![/bold green]\n")
break
# --------------------------------------------------
if __name__ == "__main__":
main_menu()