Blog icon indicating copy to clipboard operation
Blog copied to clipboard

缩短nmap扫描时间

Open zj1244 opened this issue 6 years ago • 0 comments

因为之前使用masscan+nmap的扫描方式产生漏报太多了,所以后来琢磨单单使用nmap来扫的话,时间上是否能接受?

首先看看masscan+nmap扫描一个【c段(192.168.1.1-192.168.1.255)+1-65535端口】所用的时间,基本上在22分钟左右: image

再看看使用以下参数扫描一个ip所用的时间大概在89秒左右: nmap -sV 192.168.xxx.31 -p1-65535 image image

接着添加T4参数看看速度是否有变化: image

可以看到也是89秒左右,接着继续添加--version-intensity 4参数: image

可以看到速度缩短到43秒左右,但是带来的影响是有些指纹识别不出来,如下图: image

这就需要分析哪些协议没识别出来,然后手动修改,首先在/usr/share/nmap/nmap-service-probes里查找rmiregistry,然后把rarity的值改成4就行了 image

但是有些指纹并没有rarity,如:jdwp image

这时候可以通过grep -r "Java Debug Wire Protocol" /usr/share/nmap/查找rarity的判断在哪个文件,后来找到原来在/usr/share/nmap/scripts/jdwp-version.nse文件里,修改成4,这样就可以--version-intensity 4的时候也识别出来了 image image

最后这样修改完后,仅仅使用nmap扫描,时间大概在7分钟左右 image

zj1244 avatar Jan 25 '19 01:01 zj1244