-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
718 lines (592 loc) · 27.8 KB
/
main.py
File metadata and controls
718 lines (592 loc) · 27.8 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
# =============================================================================
# DumpSec-Py - Windows Security Auditing Tool
# =============================================================================
#
# Author: Keith Pachulski
# Company: Red Cell Security, LLC
# Email: keith@redcellsecurity.org
# Website: www.redcellsecurity.org
#
# Copyright (c) 2025 Keith Pachulski. All rights reserved.
#
# License: This software is licensed under the MIT License.
# You are free to use, modify, and distribute this software
# in accordance with the terms of the license.
#
# Purpose: This script is part of the DumpSec-Py tool, which is designed to
# perform detailed security audits on Windows systems. It covers
# user rights, services, registry permissions, file/share permissions,
# group policy enumeration, risk assessments, and more.
#
# DISCLAIMER: This software is provided "as-is," without warranty of any kind,
# express or implied, including but not limited to the warranties
# of merchantability, fitness for a particular purpose, and non-infringement.
# In no event shall the authors or copyright holders be liable for any claim,
# damages, or other liability, whether in an action of contract, tort, or otherwise,
# arising from, out of, or in connection with the software or the use or other dealings
# in the software.
#
# =============================================================================
import argparse
import requests
import os
from datetime import datetime
import json
import threading
import queue
import ipaddress
import getpass
import platform
import concurrent.futures
from updater import check_for_updates
# Import standard modules
from report_writer import write_report
from user_groups import run as run_user_groups
from file_shares import run as run_file_shares
from registry_audit import run as run_registry_audit
from services_tasks import run as run_services_tasks
from local_policy import run as run_local_policy
from domain_info import run as run_domain_info
# Import new modules
from event_logs import run as run_event_logs
from powershell_audit import run as run_powershell_audit
from defender_atp import run as run_defender_atp
from container_audit import check_wsl_status, check_wsl_and_container_security
from compliance import run as run_compliance
from remote_scanner import scan_multiple_hosts
from watcher import monitor_changes
MODULES = {
"1": ("Users and Groups", run_user_groups),
"2": ("File and Share Permissions", run_file_shares),
"3": ("Registry Permissions", run_registry_audit),
"4": ("Services and Tasks", run_services_tasks),
"5": ("Local Security Policy", run_local_policy),
"6": ("Domain Trusts and Sessions", run_domain_info),
}
OUTPUT_FORMATS = ["txt", "json", "pdf", "html", "csv", "all"]
RISK_LEVELS = ["low", "medium", "high"]
def parse_args():
"""Parse command line arguments."""
parser = argparse.ArgumentParser(description="DumpSec-Py - Windows Security Auditor")
# Output options
output_group = parser.add_argument_group("Output Options")
output_group.add_argument("--output-format", choices=["txt", "json", "pdf", "html", "csv", "all"],
help="Output format: txt, json, pdf, html, csv, all")
output_group.add_argument("--output-file", help="Output filename (without extension)")
output_group.add_argument("--risk-level", choices=["low", "medium", "high"],
help="Minimum risk severity to include in report")
# Scan modes
mode_group = parser.add_argument_group("Scan Modes")
mode_group.add_argument("--watch", action="store_true", help="Enable real-time monitoring mode")
mode_group.add_argument("--compare", nargs=2, metavar=("OLD_REPORT", "NEW_REPORT"),
help="Compare two previous reports")
mode_group.add_argument("--remote", action="store_true", help="Scan remote hosts")
# Add the missing GUI parameter
mode_group.add_argument("--gui", action="store_true", help="Launch graphical user interface")
# Remote scanning options
remote_group = parser.add_argument_group("Remote Scanning Options")
remote_group.add_argument("--hosts", help="List of hosts to scan (comma-separated or file)")
remote_group.add_argument("--username", help="Username for remote authentication")
remote_group.add_argument("--key-file", help="SSH private key for remote authentication")
remote_group.add_argument("--max-threads", type=int, default=5, help="Maximum parallel scans")
# Module selection
module_group = parser.add_argument_group("Module Selection")
module_group.add_argument("--modules", help="Modules to run (comma-separated: users,shares,registry,services,policy,domain,events,powershell,defender,containers)")
# Feature flags
feature_group = parser.add_argument_group("Feature Flags")
feature_group.add_argument("--scan-event-logs", action="store_true", help="Include Windows Event Log analysis")
feature_group.add_argument("--scan-powershell", action="store_true", help="Include PowerShell security audit")
feature_group.add_argument("--scan-defender", action="store_true", help="Include Windows Defender/ATP analysis")
feature_group.add_argument("--scan-containers", action="store_true", help="Include WSL/Container security audit")
feature_group.add_argument("--map-compliance", action="store_true", help="Map findings to compliance frameworks")
# Debug options
debug_group = parser.add_argument_group("Debug Options")
debug_group.add_argument("--debug", action="store_true", help="Enable debug output")
return parser.parse_args()
def get_all_modules():
"""Get all available audit modules."""
modules = {}
# Standard modules
try:
from user_groups import run as run_user_groups
modules["users"] = ("Users and Groups", run_user_groups)
except ImportError:
print("[!] Warning: user_groups module not found")
try:
from file_shares import run as run_file_shares
modules["shares"] = ("File and Share Permissions", run_file_shares)
except ImportError:
print("[!] Warning: file_shares module not found")
try:
from registry_audit import run as run_registry_audit
modules["registry"] = ("Registry Permissions", run_registry_audit)
except ImportError:
print("[!] Warning: registry_audit module not found")
try:
from services_tasks import run as run_services_tasks
modules["services"] = ("Services and Tasks", run_services_tasks)
except ImportError:
print("[!] Warning: services_tasks module not found")
try:
from local_policy import run as run_local_policy
modules["policy"] = ("Local Security Policy", run_local_policy)
except ImportError:
print("[!] Warning: local_policy module not found")
try:
from domain_info import run as run_domain_info
modules["domain"] = ("Domain Trusts and Sessions", run_domain_info)
except ImportError:
print("[!] Warning: domain_info module not found")
# Enhanced modules
try:
from event_logs import run as run_event_logs
modules["events"] = ("Windows Event Logs", run_event_logs)
except ImportError:
print("[!] Warning: event_logs module not found or not yet implemented")
try:
from powershell_audit import run as run_powershell_audit
modules["powershell"] = ("PowerShell Security", run_powershell_audit)
except ImportError:
print("[!] Warning: powershell_audit module not found or not yet implemented")
try:
from defender_atp import run as run_defender_atp
modules["defender"] = ("Windows Defender/ATP", run_defender_atp)
except ImportError:
print("[!] Warning: defender_atp module not found or not yet implemented")
try:
from container_audit import check_wsl_and_container_security
modules["containers"] = ("WSL and Container Security", check_wsl_and_container_security)
except ImportError:
try:
# Fallback to original function if enhanced one isn't available
from container_audit import check_wsl_status
modules["containers"] = ("WSL and Container Security", check_wsl_status)
except ImportError:
print("[!] Warning: container_audit module not found or not yet implemented")
return modules
def select_modules(args):
"""Select which modules to run based on command line arguments."""
all_modules = get_all_modules()
selected_modules = {}
if args.modules:
module_list = args.modules.split(',')
for module in module_list:
if module in all_modules:
selected_modules[module] = all_modules[module]
else:
# Default modules
for module in ["users", "shares", "registry", "services", "policy", "domain"]:
selected_modules[module] = all_modules[module]
# Optional modules based on flags
if args.scan_event_logs:
selected_modules["events"] = all_modules["events"]
if args.scan_powershell:
selected_modules["powershell"] = all_modules["powershell"]
if args.scan_defender:
selected_modules["defender"] = all_modules["defender"]
if args.scan_containers:
selected_modules["containers"] = all_modules["containers"]
return selected_modules
def cli_mode(args):
"""Run in command-line mode with specified arguments."""
report_name = args.output_file or f"dumpsec_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
fmt_display = args.output_format.upper() if args.output_format != "all" else "ALL FORMATS"
print(f"[*] Running DumpSec audit in {fmt_display} mode...\n")
# Get selected modules
modules = select_modules(args)
results = {}
all_risks = []
for key, (label, func) in modules.items():
print(f"[{key}] Running {label}...")
module_results = func()
results[label] = module_results
# Collect risks for compliance mapping
if isinstance(module_results, dict) and "_risks" in module_results:
all_risks.extend(module_results["_risks"])
# Map findings to compliance frameworks if requested
if args.map_compliance:
print("[*] Mapping findings to compliance frameworks...")
compliance_report = run_compliance(all_risks)
results["Compliance Mapping"] = compliance_report
# Write report
write_report(results, args.output_format, report_name, args.risk_level)
if args.output_format == "all":
print(f"[+] Reports saved as {report_name}.txt, .json, .pdf, .html, and .csv")
else:
print(f"[+] Report saved as {report_name}.{args.output_format}")
def compare_reports(args):
"""Compare two existing reports to identify changes."""
from report_writer import compare_reports
old_report = args.compare[0]
new_report = args.compare[1]
if not os.path.exists(old_report) or not os.path.exists(new_report):
print(f"[!] One or both report files not found")
return
print(f"[*] Comparing reports: {old_report} vs {new_report}")
differences = compare_reports(old_report, new_report)
output_file = f"diff_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
with open(output_file, "w") as f:
json.dump(differences, f, indent=2)
print(f"[+] Comparison report saved as {output_file}")
# Print summary
added = sum(len(v) for v in differences["added"].values())
removed = sum(len(v) for v in differences["removed"].values())
modified = sum(len(v) for v in differences["modified"].values())
print(f"\nSummary of changes:")
print(f" - Added: {added} items")
print(f" - Removed: {removed} items")
print(f" - Modified: {modified} items")
def remote_mode(args):
"""Scan remote Windows hosts."""
if not args.hosts:
print("[!] No hosts specified. Use --hosts option.")
return
# Get hosts list
if os.path.exists(args.hosts):
with open(args.hosts, 'r') as f:
hosts = [line.strip() for line in f if line.strip()]
else:
hosts = [h.strip() for h in args.hosts.split(',') if h.strip()]
if not hosts:
print("[!] No valid hosts found.")
return
# Get credentials
username = args.username
if not username:
username = input("Enter username for remote authentication: ")
password = None
if not args.key_file:
password = getpass.getpass("Enter password (leave empty to use SSH key): ")
if not password:
key_file = input("Enter path to SSH private key: ")
else:
key_file = None
else:
key_file = args.key_file
print(f"[*] Scanning {len(hosts)} remote hosts with {args.max_threads} parallel threads")
results = scan_multiple_hosts(hosts, username, password, key_file, args.max_threads)
# Save results
output_file = args.output_file or f"remote_scan_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
with open(f"{output_file}.json", "w") as f:
json.dump(results, f, indent=2)
print(f"[+] Remote scan results saved as {output_file}.json")
# Print summary
print("\nScan summary:")
for host, result in results.items():
if "analysis" in result and "risks" in result["analysis"]:
risks = result["analysis"]["risks"]
high = sum(1 for r in risks if r.get("severity") == "high")
medium = sum(1 for r in risks if r.get("severity") == "medium")
low = sum(1 for r in risks if r.get("severity") == "low")
print(f" - {host}: {len(risks)} findings (High: {high}, Medium: {medium}, Low: {low})")
else:
print(f" - {host}: Scan failed or no findings")
def interactive_menu():
"""Run in interactive menu mode."""
try:
while True:
print("\n==== DumpSec-Py Interactive Menu ====")
print("1. Run Standard Security Audit")
print("2. Run Advanced Security Audit (includes Event Logs, PowerShell, Defender)")
print("3. Scan Remote Windows Systems")
print("4. Run Real-time Change Monitoring")
print("5. Compare Previous Reports")
print("6. Exit")
choice = input("\nEnter your choice (1-6): ").strip()
if choice == "1":
run_standard_audit()
elif choice == "2":
run_advanced_audit()
elif choice == "3":
run_remote_scan()
elif choice == "4":
print("\n[*] Starting real-time change monitoring...")
monitor_changes()
elif choice == "5":
run_report_comparison()
elif choice == "6":
print("Exiting. Goodbye!")
break
else:
print("[!] Invalid choice. Please enter a number between 1 and 6.")
except KeyboardInterrupt:
print("\n[!] Keyboard interrupt received. Exiting gracefully.")
def check_windows_version():
"""Check Windows version and return compatibility information."""
import platform
win_ver = platform.win32_ver()
# Extract major version for compatibility check
major_version = win_ver[0].split('.')[0] # Just take the first number
compatibility = {
"version": win_ver[0],
"build": win_ver[1],
"compatible": True,
"features": []
}
# Windows 10/11 specific features
if major_version in ['10', '11']:
compatibility["features"] = ["AppLocker", "WDAC", "Defender ATP", "Containers"]
return compatibility
def run_standard_audit():
"""Run a standard security audit in interactive mode."""
modules = {
"users": ("Users and Groups", run_user_groups),
"shares": ("File and Share Permissions", run_file_shares),
"registry": ("Registry Permissions", run_registry_audit),
"services": ("Services and Tasks", run_services_tasks),
"policy": ("Local Security Policy", run_local_policy),
"domain": ("Domain Trusts and Sessions", run_domain_info)
}
print("\n=== Standard Security Audit ===")
print("Select modules to run (comma-separated), or type 'all' to run all.")
for key, (label, _) in modules.items():
print(f" {key}. {label}")
selected = input("\nEnter module selection (or 'all'): ").strip().lower()
selected_modules = {}
if selected == "all":
selected_modules = modules
else:
for key in selected.split(','):
key = key.strip()
if key in modules:
selected_modules[key] = modules[key]
if not selected_modules:
print("[!] No valid modules selected. Returning to menu.")
return
# Run selected modules
results = {}
all_risks = []
for key, (label, func) in selected_modules.items():
print(f"\n[*] Running {label}...")
module_results = func()
results[label] = module_results
# Collect risks
if isinstance(module_results, dict) and "_risks" in module_results:
all_risks.extend(module_results["_risks"])
# Output options
print("\nAvailable output formats: txt, json, pdf, html, csv, all")
formats = input("Enter output format(s) (comma-separated or 'all'): ").strip().lower().split(",")
formats = [f.strip() for f in formats if f.strip()]
if "all" in formats:
formats = ["txt", "json", "pdf", "html", "csv"]
if not formats:
print("[!] No valid output formats selected. Using JSON as default.")
formats = ["json"]
# Report name
default_name = f"dumpsec_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
report_name = input(f"Enter report name (default: {default_name}): ").strip() or default_name
# Risk level filtering
min_risk = input("Minimum risk severity to include (low, medium, high)? Leave blank for all: ").strip().lower()
min_risk = min_risk if min_risk in ["low", "medium", "high"] else None
# Map to compliance frameworks?
map_compliance = input("Map findings to compliance frameworks? (y/n): ").strip().lower() == 'y'
if map_compliance:
print("\n[*] Mapping findings to compliance frameworks...")
compliance_report = run_compliance(all_risks)
results["Compliance Mapping"] = compliance_report
# Generate reports
for fmt in formats:
write_report(results, fmt, report_name, min_risk)
print(f"[+] Saved {report_name}.{fmt}")
# Add these functions after the interactive_menu() function
def run_standard_audit():
"""Run a standard security audit in interactive mode."""
modules = {
"users": ("Users and Groups", run_user_groups),
"shares": ("File and Share Permissions", run_file_shares),
"registry": ("Registry Permissions", run_registry_audit),
"services": ("Services and Tasks", run_services_tasks),
"policy": ("Local Security Policy", run_local_policy),
"domain": ("Domain Trusts and Sessions", run_domain_info)
}
print("\n=== Standard Security Audit ===")
print("Select modules to run (comma-separated), or type 'all' to run all.")
for key, (label, _) in modules.items():
print(f" {key}. {label}")
selected = input("\nEnter module selection (or 'all'): ").strip().lower()
selected_modules = {}
if selected == "all":
selected_modules = modules
else:
for key in selected.split(','):
key = key.strip()
if key in modules:
selected_modules[key] = modules[key]
if not selected_modules:
print("[!] No valid modules selected. Returning to menu.")
return
# Run selected modules
results = {}
all_risks = []
for key, (label, func) in selected_modules.items():
print(f"\n[*] Running {label}...")
module_results = func()
results[label] = module_results
# Collect risks
if isinstance(module_results, dict) and "_risks" in module_results:
all_risks.extend(module_results["_risks"])
# Output options
print("\nAvailable output formats: txt, json, pdf, html, csv, all")
formats = input("Enter output format(s) (comma-separated or 'all'): ").strip().lower().split(",")
formats = [f.strip() for f in formats if f.strip()]
if "all" in formats:
formats = ["txt", "json", "pdf", "html", "csv"]
if not formats:
print("[!] No valid output formats selected. Using JSON as default.")
formats = ["json"]
# Report name
default_name = f"dumpsec_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
report_name = input(f"Enter report name (default: {default_name}): ").strip() or default_name
# Risk level filtering
min_risk = input("Minimum risk severity to include (low, medium, high)? Leave blank for all: ").strip().lower()
min_risk = min_risk if min_risk in ["low", "medium", "high"] else None
# Map to compliance frameworks?
map_compliance = input("Map findings to compliance frameworks? (y/n): ").strip().lower() == 'y'
if map_compliance:
print("\n[*] Mapping findings to compliance frameworks...")
compliance_report = run_compliance(all_risks)
results["Compliance Mapping"] = compliance_report
# Generate reports
for fmt in formats:
write_report(results, fmt, report_name, min_risk)
print(f"[+] Saved {report_name}.{fmt}")
def run_advanced_audit():
"""Run an advanced security audit with all modules."""
all_modules = get_all_modules()
if not all_modules:
print("[!] Error: No audit modules available. Check module installation.")
return
print("\n=== Advanced Security Audit ===")
print("This will run all security audit modules, including:")
print("- Standard modules (Users, Shares, Registry, Services, Policy, Domain)")
print("- Windows Event Log analysis")
print("- PowerShell security audit")
print("- Windows Defender/ATP analysis")
print("- WSL and Container security audit")
confirm = input("\nThis may take several minutes to complete. Continue? (y/n): ").strip().lower()
if confirm != 'y':
print("Advanced audit cancelled.")
return
# Run all modules
results = {}
all_risks = []
for key, (label, func) in all_modules.items():
print(f"\n[*] Running {label}...")
try:
module_results = func()
# Ensure we always have a valid dictionary result
if module_results is None:
print(f"[!] Warning: {label} module returned None")
module_results = {"Error": "Module returned None"}
results[label] = module_results
# Collect risks safely
if isinstance(module_results, dict) and "_risks" in module_results:
# Ensure risks is an iterable
risks = module_results["_risks"]
if risks is not None:
all_risks.extend(risks)
except Exception as e:
print(f"[!] Error in {label} module: {str(e)}")
results[label] = {"Error": str(e)}
# Continue only if we have results
if not results:
print("[!] No results collected. Audit failed.")
return
# Output options
print("\nAvailable output formats: txt, json, pdf, html, csv, all")
formats = input("Enter output format(s) (comma-separated or 'all'): ").strip().lower().split(",")
formats = [f.strip() for f in formats if f.strip()]
if "all" in formats:
formats = ["txt", "json", "pdf", "html", "csv"]
if not formats:
print("[!] No valid output formats selected. Using JSON as default.")
formats = ["json"]
# Report name
default_name = f"dumpsec_advanced_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
report_name = input(f"Enter report name (default: {default_name}): ").strip() or default_name
# Risk level filtering
min_risk = input("Minimum risk severity to include (low, medium, high)? Leave blank for all: ").strip().lower()
min_risk = min_risk if min_risk in ["low", "medium", "high"] else None
# Map to compliance frameworks (automatic for advanced audit)
try:
print("\n[*] Mapping findings to compliance frameworks...")
from compliance import run as run_compliance
compliance_report = run_compliance(all_risks)
results["Compliance Mapping"] = compliance_report
except ImportError:
print("[!] Warning: compliance module not found or not yet implemented")
except Exception as e:
print(f"[!] Error mapping to compliance frameworks: {str(e)}")
# Generate reports
for fmt in formats:
try:
from report_writer import write_report
write_report(results, fmt, report_name, min_risk)
print(f"[+] Saved {report_name}.{fmt}")
except Exception as e:
print(f"[!] Error generating {fmt} report: {str(e)}")
def main():
"""Main entry point for DumpSec-Py."""
args = None # Initialize args to avoid UnboundLocalError
try:
# Load version from file
try:
with open('version.txt', 'r') as f:
version = f.read().strip()
except Exception:
version = "Unknown"
# Print banner
print(f"""
____ ____ ____
/ __ \\__ ______ ___ ____/ / /___ _____ / __ \\__ __
/ / / / / / / __ `__ \\/ __ / / __ `/ __ \\ / /_/ / / / /
/ /_/ / /_/ / / / / / / /_/ / / /_/ / /_/ // ____/ /_/ /
/_____/\\__,_/_/ /_/ /_/\\__,_/_/\\__,_/ .___//_/ \\__, /
/_/ /____/
Windows Security Auditing Tool v{version}
(c) 2025 Red Cell Security, LLC
""")
# Check Windows version compatibility
win_compat = check_windows_version()
print(f"[*] Windows Version: {win_compat['version']} (Build {win_compat['build']})")
if not win_compat['compatible']:
print("[!] Warning: This Windows version may not be fully supported.")
# Check for updates
from updater import check_for_updates
updated = check_for_updates()
if updated:
print("[*] Please restart the tool to use the updated version.")
return
# Parse command line arguments
args = parse_args()
# Handle different modes
if args.watch:
print("[*] Starting real-time change monitoring...")
monitor_changes()
elif args.compare:
compare_reports(args)
elif args.remote:
remote_mode(args)
elif args.gui:
# Import and launch GUI
try:
from gui import main as gui_main
gui_main()
except ImportError:
print("[!] GUI dependencies not found. Please install PyQt5.")
print(" pip install PyQt5")
elif args.output_format:
cli_mode(args)
else:
# No arguments provided, run in interactive menu
interactive_menu()
except KeyboardInterrupt:
print("\n[!] Keyboard interrupt received. Exiting.")
except Exception as e:
print(f"\n[!] An error occurred: {e}")
# If debug mode is enabled, print traceback
if args and hasattr(args, 'debug') and args.debug:
import traceback
traceback.print_exc()
if __name__ == "__main__":
main()