-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum-subdomains.sh
executable file
·79 lines (57 loc) · 1.97 KB
/
enum-subdomains.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
#!/bin/bash
#Colores
greenColour="\e[0;32m\033[1m"
endColour="\033[0m\e[0m"
redColour="\e[0;31m\033[1m"
blueColour="\e[0;34m\033[1m"
yellowColour="\e[0;33m\033[1m"
purpleColour="\e[0;35m\033[1m"
turquoiseColour="\e[0;36m\033[1m"
grayColour="\e[0;37m\033[1m"
domain=$1
screenshots=$domain/screenshots
tput civis
ctrl_c(){
echo -e "\n\n${redColour}[i] Saliendo...${endColour}\n"
tput cnorm && exit 1
}
# ctrl_c
trap ctrl_c INT
if [ -z $domain ]; then
echo -e "\n\n${redColour}[i] Dominio no espeficado${endColour}\n"
exit 1
fi
# Folders creation
if [ ! -d "$domain" ]; then
mkdir $domain
fi
if [ ! -d "$screenshots" ]; then
mkdir $screenshots
fi
echo -e "\n\n${greenColour}[+] Enumerando con subfinder${endColour}"
echo -e "=========================="
subfinder -silent -d $domain >> $domain/subdomains.txt
echo -e "\n\n${greenColour}[+] Enumerando con assetfinder${endColour}"
echo -e "============================"
assetfinder $domain | grep $domain >> $domain/subdomains.txt
while true; do
echo -ne "\n\n${yellowColour}[?] Usar amass? [Y/n] ${endColour}" && read ans
if [[ -z $ans || $ans == "Y" || $ans == "y" ]]; then
echo -e "\n\n${greenColour}[+] Enumerando con amass${endColour}"
echo -e "======================"
amass enum -d $domain | grep $domain | awk '{print $1}' | sort -u >> $domain/subdomains.txt
break
elif [[ $ans == "N" || $ans == "n" ]]; then
echo -e "\n\n${greenColour}[+] Saltando escaneo con amass${endColour}"
break
else
echo -e "\n\n${redColour}[!] Opción incorrecta.${endColour}"
fi
done
echo -e "\n${greenColour}[+] Encontrando dominios vivos${endColour}"
echo -e "=========================="
cat $domain/subdomains.txt | grep $domain | sort -u | httprobe -prefer-https | grep https | tr -d '//' | cut -d ':' -f 2 | tee -a $domain/alive.txt
echo -e "\n\n${greenColour}[+] Tomando screenshots de los dominios vivos${endColour}"
echo -e "===================="
gowitness scan file -f $domain/alive.txt -s $screenshots/ --no-http
tput cnorm