Skip to content

Commit 8c70cd8

Browse files
authored
Merge pull request #3 from zenfosec/pentest-automation
adding some scripts
2 parents 852ae4b + 843ad86 commit 8c70cd8

7 files changed

+32227
-74
lines changed

.tcp-full.nmap.swp

16 KB
Binary file not shown.

discover.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fi
3939

4040
# Perform port scanning using masscan
4141
echo "Performing port scanning using masscan..."
42-
masscan --rate=10000 -p1-65535 --open --banners -e en0 -iL "$2" -oG "$3"
42+
masscan --rate=10000 -p1-65535 --open --banners -iL "$2" -oG "$3"
4343
if [ $? -ne 0 ]; then
4444
echo "Error: masscan command failed. Please check your input and try again."
4545
exit 1

dohttp_s.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Parses out HTTP services from a gnmap file using nmap_http_parse.py
2+
# from github.com/zenfosec/nmap_parsing_scripts
3+
4+
# Original script written by zenfosec on 4/7/2025
5+
6+
# Check to see if the script was run with the correct number of arguments
7+
if [ "$#" -ne 2 ]; then
8+
echo "Usage: $0 <input_file> <output_file>"
9+
exit 1
10+
fi
11+
12+
./nmap_http_parse.py "$1" > "$2"
13+
if [ $? -ne 0 ]; then
14+
echo "Error: nmap_http_parse.py command failed. Please check your input and try again."
15+
exit 1
16+
fi
17+
echo "HTTP services parsed successfully. Resulting URLs saved to $2."
18+
19+
for url in $(cat "$2"); do
20+
# Check if the URL is valid
21+
if [[ $url =~ ^https?:// ]]; then
22+
# Use curl to check the HTTP response code
23+
response=$(curl -s -o /dev/null -w "%{http_code}" "$url")
24+
echo "URL: $url, Response Code: $response"
25+
urls +=("$url")
26+
else
27+
echo "Invalid URL: $url"
28+
fi
29+
done
30+
31+
for url in "${urls[@]}"; do
32+
host =$(echo "$url" | awk -F/ '{print $3}')
33+
nikto -h "$url" -T2 -oA "$url" --no-update -o nikto_$host.txt
34+
if [ $? -ne 0 ]; then
35+
echo "Error: nikto command failed. Please check your input and try again."
36+
next
37+
fi
38+
echo "Nikto scan completed for $url. Results saved to nikto_$host.txt."

enumerate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ echo "Ports: $ports"
4545
grep "Host:" "$1" | sed 's/.*Host: //' | tr ',' '\n' | awk '{print $1}' | sort -u -t . -k1,1n -k2,2n -k3,3n -k4,4n > masscan_ips.txt
4646

4747
echo "Performing service enumeration and script scanning using nmap..."
48-
nmap -sV -Pn -p $ports -T4 -iL masscan_ips.txt -oA "$2" -sC --script=default,vuln --host-timeout 10m
48+
nmap -sV -Pn -p $ports -T4 -iL masscan_ips.txt -oA "$2" -sC --script=default,vuln --script-timeout 10m --host-timeout 30m

tcp-full.gnmap

Lines changed: 25 additions & 12 deletions
Large diffs are not rendered by default.

tcp-full.nmap

Lines changed: 6512 additions & 22 deletions
Large diffs are not rendered by default.

tcp-full.xml

Lines changed: 25650 additions & 38 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)