|
本帖最后由 winpefk 于 2022-7-22 10:12 编辑
最简单的办法:curl https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=<你要查的前缀>
离线版本由于数据量过大(目前只把爬虫源码贴出来)
echo 正在获取MAC前缀对应厂商
export END=$1
export ADDR=$2echo "ibase=16;obase=10;$2"|bc > tmp
export ADDR_DEX=$(cat tmp)echo 会使用很长时间
echo 会输出ALL.bin以及大量零碎文件,请进入空目录再操作
rm ALL.bin
rm tmp
touch tmp
touch ALL.bin
##
echo 初始化线程池
down() {
wget --header="User-Agent: Mozilla/5.0 (Linux; Android 9; JDN2-AL50 Build/HUAWEIJDN2-AL50; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.116 Mobile Safari/537.36 Sec-Fetch-User: ?1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 x-requested-with: XBrowser Sec-Fetch-Site: none Sec-Fetch-Mode: navigate Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9,en-CN;q=0.8,en-US;q=0.7,en;q=0.6" "https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=$ADDR" -O $ADDR
cat $ADDR >> ALL.bin
sync
rm $ADDR
}
ex1(){
let ADDR_DEX=$ADDR_DEX+1
echo 十进制是:$ADDR_DEX
echo "ibase=10;obase=16;$ADDR_DEX"|bc > TMP
./a.out $(cat TMP) > tmp
export ADDR=$(cat TMP)
}
while true;do
echo 当前MAC前缀为:$ADDR
down &
ex1
down &
wait
sleep 1
clear
ex1
if [ $ADDR == $1 ];then
break
fi
done
echo ALL_DONE!!
我准备搞个多设备爬取(弄七八个设备去爬,要是官网的下载链接全的话就不要这么搞了)
这只是数据库获取工具用法 :MAC.SH 终止地址前缀 起始地址前缀
会输出一个包含此地址段的ALL.bin,里面有厂商信息
|
|