Repository navigation
Expand file tree
/
Copy pathcli.py
More file actions
66 lines (52 loc) · 1.7 KB
/
Copy pathcli.py
File metadata and controls
66 lines (52 loc) · 1.7 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
#!/usr/bin/env python3
"""
CipherScan CLI
Usage:
python cli.py -d example.com [--authorize] [--no-exploit]
"""
import argparse
import sys
from db import init_db, insert_scan
from cipherscan import main
from modules.utils import validate_domain, log
def parse_args():
parser = argparse.ArgumentParser(
prog="cipherscan",
description="CipherScan — Automated Security Reconnaissance & Scanning"
)
parser.add_argument(
"-d", "--domain",
required=True,
help="Target domain (e.g. example.com)"
)
parser.add_argument(
"--authorize",
action="store_true",
help="Confirm you have explicit authorization to test this target"
)
parser.add_argument(
"--no-exploit",
action="store_true",
help="Skip XSS and SQLi exploitation phases"
)
return parser.parse_args()
def main_cli():
args = parse_args()
domain = args.domain.strip().lower()
if not validate_domain(domain):
print(f"[✗] Invalid domain: {domain!r}")
sys.exit(1)
if not args.authorize:
print("\n[!] You must pass --authorize to confirm you have permission")
print(" to perform security testing on this target.")
print(" Unauthorized scanning may be illegal in your jurisdiction.\n")
sys.exit(1)
authorized = not args.no_exploit
print(f"\n[*] Starting CipherScan for: {domain}")
print(f" Exploitation phases: {'enabled' if authorized else 'disabled'}\n")
init_db()
scan_id = insert_scan(domain)
main(domain, scan_id, authorized=authorized)
print(f"\n[✓] Done. Report saved to output/{domain}/report.pdf")
if __name__ == "__main__":
main_cli()