Masscan使用心得

大范围的网络ip扫描工具,因为是自定义TCP/IP协议栈,加快了扫描速度和效率(能够在6分钟扫描整个互联网,适合在大型内网渗透使用,但可能也存在扫描速度过快导致被发现的问题)。
1.安装Masscan
apt-get install gitgcc make libpcap-dev #安装依赖包 ps:可能找不到gitgcc
git clone https://github.com/robertdavidgraham/masscan.git /opt/masscan #把代码复制 到/opt/masscan目录下
cd /opt/masscan #到目录下
make #安装
make install

2.使用Masscan
cd /opt/masscan/bin
支持nmap的很多参数,可以通过执行./masscan –nmap 查看。
*
这里值得一提的是如果此工具不支持存活判断,nmap使用-sP进行存活判,提取nmap扫描结果存活ip脚本如下:(nmap -sP ip段 -oX live.xml)

# -*- coding:utf-8 -*-
import re
xmlFile = open("live.xml")  #读取当前目录的live.xml结果文件
lines = xmlFile.read()      #读取全部内容 ,并以列表方式返回
result = re.findall(r'state="up.*\n<address addr="(.*)" addrtype',lines) #正则匹配up的ip
outFile = file("ip.txt","a+")  #输出到ip.txt
for i in result:
    outFile.write(i+'\n')
outFile.close()

拿到存活ip我们就可以使用Masscan进行扫描了,命令如下:
./masscan -p80,8000-8100 -iL ip.txt -oL liveport.xml
就可以拿到端口开放结果,后续的网页判断可以通过curl工具提取。

Masscan高级用法(echo参数用法)
root@kali:/opt/masscan/bin#
./masscan -p0-65535 10.5.27.0/24 –rate 150000 -oL output.txt –echo>scan.conf
root@kali:/opt/masscan/bin# cat scan.conf #这里查看配置
root@kali:/opt/masscan/bin# ./masscan -c scan.conf #开始扫描

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值