2020-06-02 14:35:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "Invalid usage: $0 <domain>"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
DOMAIN=$1
|
2020-10-07 11:53:57 +02:00
|
|
|
PROTOCOL="http"
|
|
|
|
|
2021-07-17 17:44:21 +02:00
|
|
|
if [[ $DOMAIN = https://* ]]; then
|
2020-10-07 11:53:57 +02:00
|
|
|
PROTOCOL="https"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DOMAIN=$(echo $DOMAIN | sed -e 's|^[^/]*//||' -e 's|/.*$||')
|
2020-06-02 14:35:52 +02:00
|
|
|
|
2023-10-29 17:22:24 +01:00
|
|
|
|
2020-06-02 14:35:52 +02:00
|
|
|
echo "[ ] Resolving IP-Address…"
|
|
|
|
output=$(resolveip $DOMAIN 2>&1)
|
|
|
|
status=$(echo $?)
|
|
|
|
if ! [[ $status == 0 ]] ; then
|
|
|
|
echo "[-] ${output}"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2023-10-29 17:22:24 +01:00
|
|
|
function sni () {
|
|
|
|
protocol=$1
|
|
|
|
sni=$2
|
|
|
|
if ! [[ "$sni" =~ ".*:[0-9]+" ]]; then
|
|
|
|
if [[ $protocol == "https" ]]; then
|
|
|
|
sni="$sni:443"
|
|
|
|
else
|
|
|
|
sni="$sni:80"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $sni
|
|
|
|
}
|
|
|
|
|
2020-06-02 14:35:52 +02:00
|
|
|
IP_ADDRESS=$(echo $output | head -n 1 | awk '{print $NF}')
|
|
|
|
echo "[+] IP-Address: ${IP_ADDRESS}"
|
|
|
|
echo "[ ] Retrieving default site…"
|
2023-10-29 17:22:24 +01:00
|
|
|
rnd=$(uuidgen)
|
|
|
|
sni=$(sni ${PROTOCOL} ${rnd}.${DOMAIN})
|
2023-09-10 11:15:00 +02:00
|
|
|
charcountDomain=$(curl -s "${PROTOCOL}://${DOMAIN}" -k -m 5 | wc -m)
|
|
|
|
charcountIpAddress=$(curl -s "${PROTOCOL}://${IP_ADDRESS}" -k -m 5 | wc -m)
|
2023-10-29 17:22:24 +01:00
|
|
|
charcountNonExistent=$(curl -s "${PROTOCOL}://${rnd}.${DOMAIN}" --resolve "${sni}:${IP_ADDRESS}" -k -m 5 | wc -m)
|
2023-09-10 11:15:00 +02:00
|
|
|
echo "[+] Chars: ${charcountDomain}, ${charcountIpAddress}, ${charcountNonExistent}"
|
2020-06-02 14:35:52 +02:00
|
|
|
echo "[ ] Fuzzing…"
|
|
|
|
|
2023-10-01 11:23:05 +02:00
|
|
|
(set -x; ffuf --fs ${charcountDomain},${charcountIpAddress},${charcountNonExistent} --fc 400 --mc all \
|
2022-01-23 22:09:12 +01:00
|
|
|
-w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt \
|
2023-10-29 17:22:24 +01:00
|
|
|
-u "${PROTOCOL}://${DOMAIN}" -H "Host: FUZZ.${DOMAIN}" "${@:2}")
|