-
Notifications
You must be signed in to change notification settings - Fork 13
/
gen_china_area_dnsrecord.sh
executable file
·81 lines (64 loc) · 2.72 KB
/
gen_china_area_dnsrecord.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
76
77
78
79
80
81
#!/bin/sh
PWD=`pwd`
gen_cnc(){
FILE=$PWD/CNC
#rm -rf $FILE.tmp
while read LINE;do
echo "$LINE"
echo -n "$LINE @ " >> $FILE.tmp
whois $LINE|egrep "address"|xargs echo >> $FILE.tmp
echo "-----------------" >> $FILE.tmp
sleep 1
done < $FILE
egrep -i "Mongolia|Cordelia|JPNIC|Beijing|Hebei|Langfang|TIANJIN|Jilin|Shijiazhuang|Jian Heng|Shenyang|Liaoning" $FILE.tmp > Huabei.cnc
egrep -i -v "Mongolia|Cordelia|JPNIC|Beijing|Hebei|Langfang|TIANJIN|Jilin|Shijiazhuang|Jian Heng|Shenyang|Liaoning" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Henan|Zhenzhou|he nan" $FILE.tmp > Huazhong.cnc
egrep -i -v "Henan|Zhenzhou|he nan" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "GuangDe|Chengdu|Taiyuan|Shanxi" $FILE.tmp > Xi.cnc
egrep -i -v "GuangDe|Chengdu|Taiyuan|Shanxi" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Qingdao|Hangzhou|pudong|Ningbo|Nanchang|ZheJiang|Shanghai|Jiangsu" $FILE.tmp > Huadong.cnc
egrep -i -v "Qingdao|Hangzhou|pudong|Ningbo|Nanchang|ZheJiang|Shanghai|Jiangsu" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Meizhou|guangxi|ShenZhen|ZhuHai|Guangzhou|Guangdong|Guang Zhou|SHUNDE|FOSHAN|GUANG DONG" $FILE.tmp > Huanan.cnc
egrep -i -v "Meizhou|guangxi|ShenZhen|ZhuHai|Guangzhou|Guangdong|Guang Zhou|SHUNDE|FOSHAN|GUANG DONG" $FILE.tmp > aaa
mv aaa $FILE.tmp
sed -r -i '/-----/d' $FILE.tmp
cat $FILE.tmp >> Huabei.cnc
sed -r -i 's#@.*##g' H*.cnc
sed -r -i 's#@.*##g' Xi.cnc
}
gen_ctc(){
FILE=$PWD/OTHER
#rm -rf $FILE.tmp
while read LINE;do
echo "$LINE"
echo -n "$LINE @ " >> $FILE.tmp
whois $LINE|egrep "address"|xargs echo >> $FILE.tmp
echo "-----------------" >> $FILE.tmp
sleep 1
done < $FILE
egrep -i "Mongolia|Cordelia|JPNIC|Beijing|Hebei|Langfang|TIANJIN|Jilin|Shijiazhuang|Jian Heng|Shenyang|Liaoning" $FILE.tmp > Huabei.ctc
egrep -i -v "Mongolia|Cordelia|JPNIC|Beijing|Hebei|Langfang|TIANJIN|Jilin|Shijiazhuang|Jian Heng|Shenyang|Liaoning" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Henan|Zhenzhou|he nan" $FILE.tmp > Huazhong.ctc
egrep -i -v "Henan|Zhenzhou|he nan" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "GuangDe|Chengdu|Taiyuan|Shanxi" $FILE.tmp > Xi.ctc
egrep -i -v "GuangDe|Chengdu|Taiyuan|Shanxi" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Qingdao|Hangzhou|pudong|Ningbo|Nanchang|ZheJiang|Shanghai|Jiangsu" $FILE.tmp > Huadong.ctc
egrep -i -v "Qingdao|Hangzhou|pudong|Ningbo|Nanchang|ZheJiang|Shanghai|Jiangsu" $FILE.tmp > aaa
mv aaa $FILE.tmp
egrep -i "Meizhou|guangxi|ShenZhen|ZhuHai|Guangzhou|Guangdong|Guang Zhou|SHUNDE|FOSHAN|GUANG DONG" $FILE.tmp > Huanan.ctc
egrep -i -v "Meizhou|guangxi|ShenZhen|ZhuHai|Guangzhou|Guangdong|Guang Zhou|SHUNDE|FOSHAN|GUANG DONG" $FILE.tmp > aaa
mv aaa $FILE.tmp
sed -r -i '/-----/d' $FILE.tmp
cat $FILE.tmp >> Huadong.ctc
sed -r -i 's#@.*##g' H*.ctc
sed -r -i 's#@.*##g' Xi.ctc
}
gen_cnc
gen_ctc