-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJaelesFuzzer.sh
130 lines (112 loc) · 4.39 KB
/
JaelesFuzzer.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# ANSI color codes
RED='\033[91m'
RESET='\033[0m'
# ASCII art
echo -e "${RED}"
cat << "EOF"
__ __ ______
/ /___ ____ / /__ _____/ ____/_ __________ ___ _____
__ / / __ `/ _ \/ / _ \/ ___/ /_ / / / /_ /_ / / _ \/ ___/
/ /_/ / /_/ / __/ / __(__ ) __/ / /_/ / / /_/ /_/ __/ /
\____/\__,_/\___/_/\___/____/_/ \__,_/ /___/___/\___/_/ v1.0.0
Made by Satya Prakash (0xKayala)
EOF
echo -e "${RESET}"
# Help menu
display_help() {
echo -e "JaelesFuzzer is a Powerful Automation tool for detecting XSS, SQLi, SSRF, Open-Redirect, etc. vulnerabilities in Web Applications\n\n"
echo -e "Usage: $0 [options]\n\n"
echo "Options:"
echo " -h, --help Display help information"
echo " -d, --domain <domain> Single domain to scan for XSS, SQLi, SSRF, Open-Redirect, etc. vulnerabilities"
echo " -f, --file <filename> File containing multiple domains/URLs to scan"
exit 0
}
# Get the current user's home directory
home_dir=$(eval echo ~"$USER")
excluded_extentions="png,jpg,gif,jpeg,swf,woff,svg,pdf,json,css,js,webp,woff,woff2,eot,ttf,otf,mp4,txt"
# Check if ParamSpider is already cloned and installed
if [ ! -d "$home_dir/ParamSpider" ]; then
echo "Cloning ParamSpider..."
git clone https://github.com/0xKayala/ParamSpider "$home_dir/ParamSpider"
fi
# Check if jaeles is installed, if not, install it
if ! command -v jaeles &> /dev/null; then
echo "Installing Jaeles..."
go install github.com/jaeles-project/jaeles@latest
fi
# Check if jaeles signatures are already cloned.
if [ ! -d "$home_dir/jaeles-signatures" ]; then
echo "Cloning jaeles-signatures..."
git clone --depth=1 https://github.com/0xKayala/jaeles-signatures "$home_dir/jaeles-signatures"
fi
# Check if httpx is installed, if not, install it
if ! command -v httpx -up &> /dev/null; then
echo "Installing httpx..."
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
fi
# Check is Jaeles signatures DB is loaded or not
jaeles config -a reload --signDir "$home_dir/jaeles-signatures/"
# Parse command line arguments
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
display_help
;;
-d|--domain)
domain="$2"
shift
shift
;;
-f|--file)
filename="$2"
shift
shift
;;
*)
echo "Unknown option: $key"
display_help
;;
esac
done
# Step 2: Ask the user to enter the domain name or specify the file
if [ -z "$domain" ] && [ -z "$filename" ]; then
echo "Please provide a domain with -d or a file with -f option."
display_help
fi
# Combined output file for all domains
output_file="output/allurls.yaml"
# Step 3: Get the vulnerable parameters based on user input
if [ -n "$domain" ]; then
echo "Running ParamSpider on $domain"
python3 "$home_dir/ParamSpider/paramspider.py" -d "$domain" --exclude "$excluded_extentions" --level high --quiet -o "output/$domain.yaml"
elif [ -n "$filename" ]; then
echo "Running ParamSpider on URLs from $filename"
while IFS= read -r line; do
python3 "$home_dir/ParamSpider/paramspider.py" -d "$line" --exclude "$excluded_extentions" --level high --quiet -o "output/$line.yaml"
cat "output/$line.yaml" >> "$output_file" # Append to the combined output file
done < "$filename"
fi
# Step 4: Check whether URLs were collected or not
if [ ! -s "output/$domain.yaml" ] && [ ! -s "$output_file" ]; then
echo "No URLs Found. Exiting..."
exit 1
fi
# Step 5: Run the Jaeles Fuzzing Signatures on the collected URLs
echo "Running Jaeles on collected URLs"
if [ -n "$domain" ]; then
# Use a temporary file to store the sorted and unique URLs
temp_file=$(mktemp)
sort "output/$domain.yaml" | uniq > "$temp_file"
httpx -silent -mc 200,301,302,403 -l "$temp_file" | jaeles scan -c 50 -s "$home_dir/jaeles-signatures/fuzz/common"
rm -r "$temp_file" # Remove the temporary file
elif [ -n "$filename" ]; then
sort "$output_file" | uniq > "$temp_file"
httpx -silent -mc 200,301,302,403 -l "$temp_file" | jaeles scan -c 50 -s "$home_dir/jaeles-signatures/fuzz/common"
rm -r "$temp_file" # Remove the temporary file
fi
# Step 6: End with a general message as the scan is completed
echo "Scan is completed - Happy Hunting"