国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

從apnic提取ip信息腳本分享

2019-10-26 18:39:18
字體:
來源:轉載
供稿:網友

代碼如下:
#!/bin/bash

# download from apnic
rm -f delegated-apnic-latest
wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest

# IPs allocated to china.
grep 'apnic|CN|ipv4|' delegated-apnic-latest | cut -f 4 -d'|' > delegated-apnic-CN

# get detail of echo IP from apnic database.
rm -f apnic_CN.txt
while read ip
do
    # query apnic database
    echo "query who is $ip"
    whois -h whois.apnic.net $ip > tmp.txt
    grep inetnum  tmp.txt >> apnic_CN.txt          # IP range
    grep netname  tmp.txt >> apnic_CN.txt          # netname which include sp information 
    grep descr    tmp.txt >> apnic_CN.txt          # description which include province information
    echo ""  >> apnic_CN.txt          
done < delegated-apnic-CN

# clean up
rm -f tmp.txt
rm -f delegated-apnic-latest
rm -f delegated-apnic-CN

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 湘潭市| 临西县| 延川县| 潞城市| 澎湖县| 石景山区| 原平市| 金川县| 微博| 伊宁市| 阿巴嘎旗| 长武县| 鹤壁市| 新野县| 株洲县| 宁化县| 米脂县| 驻马店市| 柳河县| 石楼县| 江西省| 于田县| 长岭县| 安义县| 荥阳市| 白银市| 福安市| 崇州市| 新兴县| 沐川县| 庆安县| 兴山县| 胶州市| 克东县| 平泉县| 长沙市| 县级市| 五家渠市| 龙胜| 龙胜| 永州市|