-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthenticated.sh
48 lines (39 loc) · 1.35 KB
/
authenticated.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
#!/bin/bash
# Parse command-line arguments
while getopts "d:c:" flag; do
case "${flag}" in
d) domain=${OPTARG};;
c) cookie=${OPTARG};;
esac
done
# Perform subdomain enumeration
echo "Enumerating subdomains for $domain..."
subfinder -d $domain | tee subdomains.txt
# Perform HTTP probing
echo "Probing HTTP endpoints..."
httpx -l subdomains.txt -o httpx.txt
# Identify endpoints with potential XSS
echo "Identifying endpoints with potential XSS..."
cat httpx.txt | gau --threads 5 >> endpoints.txt
cat endpoints.txt | gf xss >> potential_xss.txt
# Perform authenticated XSS testing with dalfox
echo "Performing authenticated XSS testing with dalfox..."
# Prepare a file containing the XSS endpoints
cat potential_xss.txt | cut -d ':' -f 2-3 | sed 's/^\/\///' | sed 's/:/\//' | sort -u > xss_endpoints.txt
# Iterate through each endpoint and test with dalfox
while IFS= read -r endpoint; do
echo "Testing endpoint: $endpoint"
torsocks dalfox url "https://$endpoint" \
--cookie "$cookie" \
--skip-bav \
--follow-redirect \
-o "dalfox_output_$endpoint.txt"
done < xss_endpoints.txt
# Cleanup temporary files
echo "Cleaning up..."
rm subdomains.txt
rm httpx.txt
rm endpoints.txt
rm potential_xss.txt
rm xss_endpoints.txt
echo "Script execution completed."