-
Notifications
You must be signed in to change notification settings - Fork 0
/
domainfinder.sh
executable file
·63 lines (55 loc) · 1.86 KB
/
domainfinder.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
#!/bin/bash
# Simple script for bruteforcing finding subdomains by bruteforce and finding cname registries for possible domain takeover
# Made by: Sp1d3rM0rph3us
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NC='\033[0m'
print_red() {
printf "${RED}$1${NC}\n"
}
print_green() {
printf "${GREEN}$1${NC}\n"
}
print_blue(){
printf "${BLUE}$1${NC}\n"
}
print_yellow() {
printf "${YELLOW}$1${NC}\n"
}
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
printf "Usage: $0 [OPTION] [domain] [wordlist]\n"
printf "\n"
printf "OPTIONS: -t [takeover-mode], -e [enum-mode]\n"
printf "\n"
printf "[-t] - Takeover mode. It will only look for cname registries.\n"
printf "[-e] - Enumeration mode. It will look for subdomains in general\n"
else
if [[ "$1" == "" || "$2" == "" || "$3" == "" ]]; then
printf "Usage: $0 [OPTION] [domain] [wordlist]\n"
printf "Type $0 -h or --help for more information\n"
printf "Script by: Sp1d3rM0rph3us\n"
else
wordlist=$(cat "$3")
if [ "$1" == "-t" ]; then
print_yellow "[*] Bruteforcing cname registries of $2...\n"
for word in $wordlist; do
host -t cname "$word.$2" | grep "is an alias for" | sed 's/is an alias for/-->/; s/\.$//; s/^/[+] /'
sleep 1
done
printf "\n"
print_red "Obliterating your privacy, as usual."
elif [ "$1" == "-e" ]; then
print_yellow "[*] Bruteforcing subdomains of $2...\n"
for word in $wordlist; do
host "$word.$2" | grep -v "NXDOMAIN" | sed 's/\.$//; s/^/[+] /'
sleep 0.5
done
printf "\n"
print_red "Obliterating your privacy, as usual."
else
print_red "[-] Unrecognized option: $1"
fi
fi
fi