-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsub3num.sh
72 lines (61 loc) · 2.11 KB
/
sub3num.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
#!/bin/bash
cur=$(pwd)
url=$1
if [ ! -d "$url" ];then
mkdir $url
fi
if [ ! -d "$url/subdomanins" ];then
mkdir $url/subdomanins
fi
RED="\033[1;31m"
RESET="\033[0m"
#####################################################################
cd $cur/$url/subdomanins
echo "[🚀] Finding Subdomains..."
#Assetfinder
touch assetfinder.txt
assetfinder $url >> assetfinder.txt
cat assetfinder.txt | grep $1 >> assetfinder.txt
echo "[✔️]Assetfinder DONE! - $(wc -l assetfinder.txt|cut -f 1 -d " ") Domains"
#findomain
cd $cur/tools
./findomain-linux -t $url -o >/dev/null
mv $url.txt $cur/$url/subdomanins/findomain.txt
cd $cur/$url/subdomanins
echo "[✔️]findomain DONE! - $(wc -l findomain.txt|cut -f 1 -d " ") Domains"
#subfinder
touch subfinder.txt
subfinder -d $url -o subfinder.txt >/dev/null 2>&1
echo "[✔️]subfinder DONE! - $(wc -l subfinder.txt|cut -f 1 -d " ") Domains"
#sublist3r
touch sublister.txt
python3 $cur/tools/Sublist3r/sublist3r.py -d $url -o sublister.txt >/dev/null 2>&1
echo "[✔️]sublist3r DONE! - $(wc -l sublister.txt|cut -f 1 -d " ") Domains"
#Amass
touch amass.txt
echo -n "[➕]Amass Started"
echo -n -e "${RED}..........might take some time ...Ctrl+C after 10s to stop Amass${RESET}"
amass enum -d $url -o amass.txt >/dev/null 2>&1
echo " [✔️]Amass Done! - $(wc -l amass.txt|cut -f 1 -d " ") Domains"
echo "[🥂]Subdomain Enum Completed !!!"
##########################################################################
echo -n "[📝]Merge and Sort"
touch merged
cat *.txt >merged
touch unique
sort -u merged > unique
echo -n "= $(wc -l unique|cut -f 1 -d " ") Domains"
echo ""
echo "[🏁]Final Alive Check.."
touch final
cat unique | sort -u |httprobe -s -p https:443| sed 's/https\?:\/\///' | tr -d ':443' > final
echo -n -e "\e[1;36m All Subdomains are stored in: $(pwd)/final\e[0m"
echo -n -e "\e[1;32m - [$(wc -l final |cut -f 1 -d " ") Domains]\e[0m"
echo " "
#############################################################################
# stko
echo "[+]Subdomain Takeover?[y/n]"
read ans
if [ "y" == "$ans" ];then
subjack -w $cur/$url/subdomanins/unique -t 100 -timeout 30 -v -o stko.txt -ssl
fi