-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathadbasher.py
More file actions
executable file
·92 lines (78 loc) · 2.5 KB
/
adbasher.py
File metadata and controls
executable file
·92 lines (78 loc) · 2.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
#!/usr/bin/env python3
"""
ADBasher - Automated Active Directory Penetration Testing Framework
A comprehensive framework for AD security assessments.
"""
import argparse
import sys
from core.orchestrator import Orchestrator
__version__ = "2.0.0"
def main():
parser = argparse.ArgumentParser(
description="ADBasher - Automated Active Directory Penetration Testing Framework",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
%(prog)s -t corp.local # Scan single domain
%(prog)s -t 192.168.1.0/24 # Scan network range
%(prog)s -t dc01.corp.local dc02.corp.local # Multiple targets
%(prog)s -t corp.local --opsec stealth # Stealth mode
%(prog)s --dry-run -t corp.local # Validate without execution
"""
)
# Version
parser.add_argument(
"-v", "--version",
action="version",
version=f"%(prog)s {__version__}"
)
# Target Specification
parser.add_argument(
"-t", "--target",
nargs="+",
metavar="TARGET",
help="Target IP(s), CIDR(s), or Domain(s)"
)
# Operational Modes
parser.add_argument(
"--opsec",
choices=["standard", "stealth", "aggressive"],
default="standard",
help="Operational Security / Evasion level (default: standard)"
)
# Execution Control
parser.add_argument(
"--resume",
metavar="SESSION_ID",
help="Resume a previous session by ID"
)
# Dry Run Mode
parser.add_argument(
"--dry-run",
action="store_true",
help="Validate configuration and targets without executing attacks"
)
# Verbosity
parser.add_argument(
"-q", "--quiet",
action="store_true",
help="Suppress non-essential output"
)
args = parser.parse_args()
# Basic Validation
if not args.target and not args.resume:
parser.print_help()
print("\n[!] Error: No target specified. Use -t/--target or --resume.")
sys.exit(1)
# Dry Run Mode
if args.dry_run:
print(f"[*] ADBasher v{__version__} - Dry Run Mode")
print(f"[*] Targets: {', '.join(args.target) if args.target else 'N/A (resuming session)'}")
print(f"[*] OpSec Level: {args.opsec}")
print(f"[*] Configuration valid. Ready for execution.")
sys.exit(0)
# Initialize and Run
engine = Orchestrator(args)
engine.run()
if __name__ == "__main__":
main()