-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainScript.py
More file actions
44 lines (30 loc) · 1.35 KB
/
Copy pathmainScript.py
File metadata and controls
44 lines (30 loc) · 1.35 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
#!/usr/bin/env python3
import os
import sys
import subprocess
# Prompt the user for the target IP address
TARGET_IP = input("Enter the target IP address: ")
# Prompt the user for the port range
PORT_RANGE = input("Enter the port range (e.g., 1-1024): ")
# Prompt the user for the vulnerability scanner
VULNERABILITY_SCANNER = input("Enter the vulnerability scanner (e.g., nmap): ")
# Prompt the user for the exploit tool
EXPLOIT_TOOL = input("Enter the exploit tool (e.g., metasploit): ")
# Prompt the user for the output directory
OUTPUT_DIR = input("Enter the output directory (e.g., /path/to/output): ")
# Define the port scan script
PORT_SCAN_SCRIPT = "portscanner.py"
# Define the vulnerability scan script
VULNERABILITY_SCAN_SCRIPT = "vulnerability_scan.sh"
# Define the exploit script
EXPLOIT_SCRIPT = "exploit.py"
# Create the output directory if it does not exist
if not os.path.exists(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
# Run the port scan script
subprocess.run(["./" + PORT_SCAN_SCRIPT, TARGET_IP, PORT_RANGE, OUTPUT_DIR], check=True)
# Run the vulnerability scan script
subprocess.run(["./" + VULNERABILITY_SCAN_SCRIPT, TARGET_IP, VULNERABILITY_SCANNER, PORT_RANGE, OUTPUT_DIR], check=True)
# Run the exploit script
subprocess.run(["./" + EXPLOIT_SCRIPT, TARGET_IP, EXPLOIT_TOOL, OUTPUT_DIR], check=True)
print("Penetration testing tasks completed.")