- A+
创意源自:[link href="WooYun: DNSPod域名无验证所有权限(可导致域名被恶意接管使用)"]DNSPod域名无验证所有权限(可导致域名被恶意接管使用)[/link]
#!/bin/bash
#
# Downlaod domain list at: http://www.dailychanges.com/dnspod.net/
#
DAILYCHALES_DOMAINLIST_CSV="./domain.csv"
DOMAIN_LIST="./domain.lst"
DOMAIN_SAVE="./save.lst"
DEFAULT_NS="F1G1NS1.DNSPOD.NET"
WARN="\033[1;33m"
ERR="\033[0;31m"
SUCCESS="\033[1;32m"
RST="\033[0m"
function checkDomainCofniguredByWhois {
echo -n "checkDomainCofniguredByWhois: checking $1..."
NS=$(whois $1 | grep "Name Server" | awk -F":" '{print $2}' | head -n1)
[[ -z $NS ]] && echo " $WARN whois error$RST" && return 1
[[ ! -z $(nslookup $1 $NS | grep -E "NXDOMAIN|SERVFAIL|timed") ]] && echo -e "$SUCCESS unconfiged$RST" && echo "$1" >> $DOMAIN_SAVE || echo -e "$ERR configed$RST"
}
function checkDomainCofniguredByNS {
echo -n "checkDomainCofniguredByNS: checking $1 in $2..."
[[ ! -z $(nslookup $1 $DEFAULT_NS | grep -E "NXDOMAIN|SERVFAIL|timed") ]] && echo -e "$SUCCESS unconfiged$RST" && echo "$1" >> $DOMAIN_SAVE || echo -e "$ERR configed$RST"
}
function checkDomainList {
echo "checkDomainList: start check process"
for domain in $(cat $DOMAIN_LIST)
do
checkDomainCofniguredByNS $domain $DEFAULT_NS
done
}
function processDomainList {
echo "processDomainList: processing $DAILYCHALES_DOMAINLIST_CSV"
cat $DAILYCHALES_DOMAINLIST_CSV | grep ,new, | sed -e "s/,new,//g" > $DOMAIN_LIST
dos2unix $DOMAIN_LIST
}
processDomainList
checkDomainList
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫