Loading

centOS下masscan安装

号称 5 分钟扫描完全部互联网,一秒能发 1 亿数据包,项目地址:

https://github.com/robertdavidgraham/masscan

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
posted @ 2021-10-08 22:09  紫曜花  阅读(585)  评论(0编辑  收藏  举报