1.添加epel的YUM源,否则许多组件一会会找不到
cd /etc/yum.repos.d/
rpm --import http://mirrors.ustc.edu.cn/fedora/epel/RPM-GPG-KEY-EPEL-6
wget https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/epel?codeblock=0
mv epel?codeblock=0 epel.repo
wget https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/epel?codeblock=1
mv epel?codeblock=1 epel-testing.repo
yum makecache
yum update
yum install gmp gmp-devel libpcap-devel gengetopt byacc flex json-c-devel cmake git redis gcc hiredis-devel automake autoconf libtool mlocate
3.下载zmap
git clone git://github.com/zmap/zmap.git
4.安装Zmap
cd zmap
cmake -DWITH_REDIS=ON -DWITH_JSON=OFF -DENABLE_DEVELOPMENT=OFF -DENABLE_HARDENING=OFF ./
make
make install
5.测试是否安装乐成
zmap -h
6.让zmap支持banner扫描
上述要领在centos 6.5
x64上一次编译安装乐成.如碰着其他诡异问题接待留言交换
下面是如何让Zmap支持Banner扫描,需要编译安装包内的banner-grab组件
#首先进入banner-grab目次
cd zmap/examples/banner-grab
#下载必需组件libevent,不然无法编译,yum下载的是1.0的版本,无法利用.
wget https://github.com/libevent/libevent/archive/release-2.0.21-stable.tar.gz
tar -zxvf release-2.0.21-stable.tar.gz
cd release-2.0.21-stable
sh autogen.sh
./configure
make
make install
#返回banner-grab目次,美国抗攻击服务器 亚洲服务器,并编译
cd ../
make
#运行下面呼吁测试是否编译乐成,默认会报错,因为libevent路径差池
./banner-grab-tcp
#运行如下呼吁,查察关联文件信息
ldd banner-grab-tcp
linux-vdso.so.1 => (0x00007fff24dff000)
libpcap.so.1 => /usr/lib64/libpcap.so.1 (0x00007f05b6bf8000)
libevent-2.0.so.5 => not found
libevent_extra-2.0.so.5 => not found
libm.so.6 => /lib64/libm.so.6 (0x00007f05b6973000)
libc.so.6 => /lib64/libc.so.6 (0x00007f05b65df000)
/lib64/ld-linux-x86-64.so.2 (0x00007f05b6e3e000)
#发明缺少libevent-2.0.so.5和libevent_extra-2.0.so.5
#利用locate呼吁,找到,并用ln成立链接如下
locate libevent-2.0.so.5
locate libevent_extra-2.0.so.5
#x86主机ln 到/lib
#x64主机ln 到/lib64
ln -s /usr/local/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5
ln -s /usr/local/lib/libevent_extra-2.0.so.5 /lib64/libevent_extra-2.0.so.5
#再次运行乐成
./banner-grab-tcp
下面是Zmap扫描Banner信息的要领
#拷贝banner-grab-tcp、http-req到需要运行zmap呼吁的目次,好比/root/下,然后运行下面呼吁利用banner扫描
zmap -p 80 220.110.1.1/16 -o-|./banner-grab-tcp -d http-req -p 80 >result.log