centOS下masscan安裝
阿新 • • 發佈:2021-10-08
號稱 5 分鐘掃描完全部網際網路,一秒能發 1 億資料包,專案地址:
1. 安裝masscan
git clone https://github.com/robertdavidgraham/masscan
cd masscan
make
make install
完成之後,檢視軟體幫助資訊:
massscan -h
2. 安裝 libpcap
安裝完 masscan 後還需安裝 libpcap ,安裝步驟如下
1.安裝GCC:
yum -y install gcc-c++
2.安裝flex:
yum -y install flex
沒有flex,直接安裝libpcap會提示"Your operating system's lex is insufficient to compile libpcap"錯誤;
3.安裝bison
yum -y install bison
前面安裝的是flex,就需要搭配bison,如不會提示"don't have both flex and bison;reverting to lex/yacc"錯誤;
4.安裝 libpcap
下載地址:http://www.tcpdump.org/
下載版本:wget -c http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz
解壓軟體包:``tar zxf libpcap-1.0.0.tar.gz`
進入解壓後的目錄,輸入命令列:
命令如下:
./configure
make
make install
如果出現以下問題
由於libpcap已經安裝,所以是程式無法找到庫所在的位置的原因。
解決辦法:
將 libpcap.so.1 所在目錄新增到檔案 /etc/ld.so.conf
中,
開啟ld.so.conf檔案,然後新增一行 /usr/local/lib :
vim /etc/ld.so.conf
大功告成。
3. 使用
指定埠
masscan -p53 8.8.8.0/24
指定掃描速率
masscan 8.8.8.8 -p0-65535 --max-rate 10000
排除目標
masscan 10.11.0.0/16 --top-ports 100 --excluedefile exclude.txt
儲存掃描結果
masscan 10.11.0.0/16 --top-ports 100 > result.txt
# 或
masscan 0.0.0.0/0 -p0-65535 -oX scan.x ml