-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
51 lines (39 loc) · 1.62 KB
/
Copy pathcli.py
File metadata and controls
51 lines (39 loc) · 1.62 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
import argparse
import sys
from core.scanner import ScannerCore, SCAN_COMMANDS
def main():
parser = argparse.ArgumentParser(description="VulnzxScanX - Vulnerability Scanner CLI")
parser.add_argument("-t", "--target", required=True, help="Target IP or hostname")
parser.add_argument("-s", "--type", choices=SCAN_COMMANDS.keys(), default="Quick", help="Scan type (default: Quick)")
parser.add_argument("-o", "--output", help="Output file to save results")
parser.add_argument("-r", "--rotate", action="store_true", help="Rotate IP using Tor before scanning")
args = parser.parse_args()
scanner = ScannerCore()
print(f"[*] Target: {args.target}")
print(f"[*] Scan Type: {args.type}")
if args.rotate:
scanner.rotate_ip()
if not scanner.is_host_up(args.target):
print(f"[!] Warning: Target {args.target} appears to be down. Proceeding anyway...")
command = SCAN_COMMANDS[args.type](args.target)
try:
output_file = None
if args.output:
output_file = open(args.output, "a")
for line in scanner.run_scan(command, args.target):
sys.stdout.write(line)
sys.stdout.flush()
if output_file:
output_file.write(line)
if output_file:
output_file.close()
print(f"\n[+] Results saved to {args.output}")
except KeyboardInterrupt:
print("\n[!] Scan interrupted by user. Cleaning up...")
scanner.stop_scan()
sys.exit(1)
except Exception as e:
print(f"\n[!] Error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()