1、基础环境安装
yum update
yum -y install gcc gcc-c++
yum -y install gcc automake autoconf libtool make
yum -y install git
yum -y install flex
yum -y install bison
yum -y install wget
yum -y install byacc
yum -y install clang
yum -y install libpcap-dev
2、masscan安装(源码)
1、进入opt目录
cd /opt
2、下载源码
git clone https://github.com/robertdavidgraham/masscan
3、进入masscan
cd masscan
4、安装masscan
make clean
make
make clean
make install
5、设置环境变量
打开:
vim /etc/profile
文件尾添加
PATH=/opt/masscan/bin:$PATH
export PATH
重启配置文件:
source /etc/profile
如果重启后失效(直接执行这个应该也行,没试)
cp masscan/bin/masscan /bin
3、安装libpcap
1、创建文件夹并进入:
mkdir /opt/libpcap
cd /opt/libpcap
2、下载源码并减压:
wget -c http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz
tar -zxvf libpcap-1.5.3.tar.gz
3、进入文件:
cd libpcap-1.5.3
4、安装:
./configure
如果报错执行,不同的系统可能情况不一样,具体情况具体分析:
./configure --build=arm-linux
make
make install
5、没有生效解决办法:
将libpcap.so.1所在的目录添加到文件/etc/ld.so.conf中
vim /etc/ld.so.conf
添加一行:
/usr/local/lib
结果如下:
include ld.so.conf.d/*.conf # 原始内容
/usr/local/lib # 新增内容
保存退出:
:wq
然后执行:
ldconfig
4、测试
终端输入 xxdscan 或 masscan,出现下面的情况安装成功:
[root@b8030df98be1 work]# masscan 或 xxdscan
usage:
masscan -p80,8000-8100 10.0.0.0/8 --rate=10000
scan some web ports on 10.x.x.x at 10kpps
masscan --nmap
list those options that are compatible with nmap
masscan -p80 10.0.0.0/8 --banners -oB <filename>
save results of scan in binary format to <filename>
masscan --open --banners --readscan <filename> -oX <savefile>
read binary scan results in <filename> and save them as xml in <savefile>