nmap快速扫描大量主机端口方法

楼底命令楼主自用

一、端口扫描

nmap -sS -Pn -n --open -T4  -iL /tmp/97.txt -oX /opt/dd.xml

-sS:使用SYN方式扫描,默认用的是-sT方式,即TCP方式,需要完成完整的三次握手,比较费时,SYN就比较快一些了;

-Pn: 禁用PING检测,这样速度快,并且可以防止有些主机无法ping通而被漏掉不扫描;

-n: 不解析域名,加快扫描速度
–open: 只输出检测状态为open的端口,即开放的端口;
-T4:总共有T0-T5,貌似T4比较折中
-iL:载入ip段文件,批量扫,不用一条条执行了。
-oX:结果另存在xxx.xml格式

不过楼主这里用的是后台扫描

nohup nmap -sS -Pn -n --open -T4  -iL /tmp/97.txt -oX /opt/dd.xml &

在这里插入图片描述
命令没执行完之前,都会在进程中(第一个箭头)
命令执行完后,nohup命令就会弹出提示,进程中的命令也会跟着消失(第二个箭头)
在这里插入图片描述

二、导入成Excel报告

python3 nmapReport.py -r /opt/dd.xml -o qidao.xlsx

在这里插入图片描述

三、扫描速度

在这里插入图片描述

四、关于转换命令结果问题

在这里插入图片描述

参考文章:

https://www.cnblogs.com/cyrusxx/p/12562867.html

nohup nmap -sS -Pn -n --open -T4 -iL /tmp/97.txt -oX /opt/dd.xml &

cd /tmp/

python3 /opt/nmapReport-master/nmapReport.py -r /opt/dd.xml -o /tmp/test6666.xlsx
在这里插入图片描述

更新

nohup nmap -sS -Pn -n --open -p 389 -T4  -iL /tmp/97.txt -oX /opt/dd.xml &
nmap -sS -Pn -n --open -p 389 -T4  -iL 1.txt -oX dd.xml

猜你喜欢

转载自blog.csdn.net/qq_45300786/article/details/120139192