forked from ebelties/DomainWatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdomainwatch.sh
45 lines (43 loc) · 2.22 KB
/
domainwatch.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
#!/bin/bash
RESET='\033[0m'
FOUND='\033[0;31mAVAILABLE:\033[0;32m'
if [[ $# -eq 0 ]] ; then
echo -e "\n\t\033[0;32mDomainWatch\033[0m - Monitor domain lists for possible take-over\n\n\tScan your domain list:\n\t\t./${0##*/} scan <domain_list>\n\n\tAdd a domain to your domain list:\n\t\t./${0##*/} add <domain> <domain_list>\n"
exit 0
fi
if [[ $1 == "add" ]]; then
echo "$2" >> "$3"
echo -e "\n\tDomain \033[0;32m$2\033[0m added to \033[0;32m$3\033[0m!\n"
exit 0
elif [[ $1 == "scan" ]]; then
while IFS='' read -r line || [[ -n "$line" ]]; do
HTML=$(curl -Lks "$line" --max-time 10)
if [[ $HTML == *"If you're the owner of this store"* ]]; then
echo -e "${FOUND} Shopify!${RESET} $line"
elif [[ $HTML == *"Generated by cloudfront (CloudFront)"* ]]; then
echo -e "${FOUND} CloudFront!${RESET} $line"
elif [[ $HTML == *"NoSuchBucket"* ]]; then
echo -e "${FOUND} S3 Bucket!${RESET} $line"
elif [[ $HTML == *"There is no app configured at that hostname"* ]]; then
echo -e "${FOUND} Heroku!${RESET} $line"
elif [[ $HTML == *"Are you trying to publish one"* ]]; then
echo -e "${FOUND} GitHub!${RESET} $line"
elif [[ $HTML == *"Your custom domain mapping"* ]] ||
[[ $HTML == *"Squarespace - Website Expired"* ]] ||
[[ $HTML == *"No Such Account"* ]]; then
echo -e "${FOUND} Squarespace!${RESET} $line"
elif [[ $HTML == *"This UserVoice subdomain is currently not available"* ]]; then
echo -e "${FOUND} UserVoice!${RESET} $line"
elif [[ $HTML == *"Error 404 (Not Found)!!1"* ]]; then
echo -e "${FOUND} Google!${RESET} $line"
elif [[ $HTML == *"Unless you were looking for this error page"* ]]; then
echo -e "${FOUND} Tumblr!${RESET} $line"
elif [[ $HTML == *"The site you were looking for couldn't be found"* ]]; then
echo -e "${FOUND} WP Engine!${RESET} $line"
elif [[ $HTML == *"No help desk at"* ]]; then
echo -e "${FOUND} Zendesk!${RESET} $line"
elif [[ $HTML == *"has been added to a service"* ]]; then
echo -e "${FOUND} Fastly!${RESET} $line"
fi
done < "$2"
fi