Skip to content

Commit 5abbfdf

Browse files
authored
Update NucleiFuzzer.sh
1 parent ff4de21 commit 5abbfdf

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

NucleiFuzzer.sh

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ printf "\e[91m
66
/ | / /_ _______/ /__ (_) ____/_ __________ ___ _____
77
/ |/ / / / / ___/ / _ \/ / /_ / / / /_ /_ / / _ \/ ___/
88
/ /| / /_/ / /__/ / __/ / __/ / /_/ / / /_/ /_/ __/ /
9-
/_/ |_/\__,_/\___/_/\___/_/_/ \__,_/ /___/___/\___/_/
9+
/_/ |_/\__,_/\___/_/\___/_/_/ \__,_/ /___/___/\___/_/ v1.0.1
1010
1111
Made by Satya Prakash (0xKayala)
1212
\e[0m"
@@ -17,7 +17,8 @@ display_help() {
1717
echo -e "Usage: $0 [options]\n\n"
1818
echo "Options:"
1919
echo " -h, --help Display help information"
20-
echo " -d, --domain <domain> Domain to scan for XSS, SQLi, SSRF, Open-Redirect, etc. vulnerabilities"
20+
echo " -d, --domain <domain> Single domain to scan for XSS, SQLi, SSRF, Open-Redirect, etc. vulnerabilities"
21+
echo " -f, --file <filename> File containing multiple domains/URLs to scan"
2122
exit 0
2223
}
2324

@@ -48,7 +49,7 @@ if ! command -v httpx &> /dev/null; then
4849
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
4950
fi
5051

51-
# Step 1: Parse command line arguments
52+
# Parse command line arguments
5253
while [[ $# -gt 0 ]]
5354
do
5455
key="$1"
@@ -61,32 +62,53 @@ do
6162
shift
6263
shift
6364
;;
65+
-f|--file)
66+
filename="$2"
67+
shift
68+
shift
69+
;;
6470
*)
6571
echo "Unknown option: $key"
6672
display_help
6773
;;
6874
esac
6975
done
7076

71-
# Step 2: Ask the user to enter the domain name
72-
if [ -z "$domain" ]; then
73-
echo "Enter the domain name (eg: target.com):"
74-
read domain
77+
# Step 2: Ask the user to enter the domain name or specify the file
78+
if [ -z "$domain" ] && [ -z "$filename" ]; then
79+
echo "Please provide a domain with -d or a file with -f option."
80+
display_help
7581
fi
7682

77-
# Step 3: Get the vulnerable parameters of the given domain name using ParamSpider tool and save the output into a text file
78-
echo "Running ParamSpider on $domain"
79-
python3 "$home_dir/ParamSpider/paramspider.py" -d "$domain" --exclude png,jpg,gif,jpeg,swf,woff,gif,svg --level high --quiet -o output/$domain.txt
83+
# Combined output file for all domains
84+
output_file="output/allurls.txt"
8085

81-
# Check whether URLs were collected or not
82-
if [ ! -s output/$domain.txt ]; then
86+
# Step 3: Get the vulnerable parameters based on user input
87+
if [ -n "$domain" ]; then
88+
echo "Running ParamSpider on $domain"
89+
python3 "$home_dir/ParamSpider/paramspider.py" -d "$domain" --exclude png,jpg,gif,jpeg,swf,woff,gif,svg --level high --quiet -o "output/$domain.txt"
90+
cat "output/$domain.txt" >> "$output_file" # Append to the combined output file
91+
elif [ -n "$filename" ]; then
92+
echo "Running ParamSpider on URLs from $filename"
93+
while IFS= read -r line; do
94+
python3 "$home_dir/ParamSpider/paramspider.py" -d "$line" --exclude png,jpg,gif,jpeg,swf,woff,gif,svg --level high --quiet -o "output/$line.txt"
95+
cat "output/$line.txt" >> "$output_file" # Append to the combined output file
96+
done < "$filename"
97+
fi
98+
99+
# Step 4: Check whether URLs were collected or not
100+
if [ ! -s "output/$domain.txt" ] && [ ! -s "$output_file" ]; then
83101
echo "No URLs Found. Exiting..."
84102
exit 1
85103
fi
86104

87-
# Step 4: Run the Nuclei Fuzzing templates on $domain.txt file
88-
echo "Running Nuclei on $domain.txt"
89-
cat output/$domain.txt | httpx -silent -mc 200,301,302,403 | nuclei -t "$home_dir/fuzzing-templates" -rl 05
105+
# Step 5: Run the Nuclei Fuzzing templates on the collected URLs
106+
echo "Running Nuclei on collected URLs"
107+
if [ -n "$domain" ]; then
108+
cat "output/$domain.txt" | httpx -silent -mc 200,301,302,403 | nuclei -t "$home_dir/fuzzing-templates" -rl 05
109+
elif [ -n "$filename" ]; then
110+
cat "$output_file" | httpx -silent -mc 200,301,302,403 | nuclei -t "$home_dir/fuzzing-templates" -rl 05
111+
fi
90112

91-
# Step 5: End with a general message as the scan is completed
113+
# Step 6: End with a general message as the scan is completed
92114
echo "Scan is completed - Happy Fuzzing"

0 commit comments

Comments
 (0)