Nmap基础命令:
1.host-discovery主机发现,开机状态,批量探测CIDR:nmap -sP CIDR
--例172.16.1.1/24即172.16.1.1~172.16.1.255。使用TCP SYN和ICMP Echo Request 来探测存活
nmap -sn CIDR 相同,都是不进行端口扫描
-V: Print version number
-sV: Probe open ports to determine service/version info探测打开的端口以确定服务/版本信息
过滤了SYN就用ACK PING
过滤ACK PING 就用ICMP Echo_Request
过滤ICMP Echo_Request就用ICMP timestamp
NSE分类使用:
nmap -T4 --script http-title scanme.nmap.org
nmap -T4 --script http-headers scanme.nmap.org
nmap -sV --script vuln scanme.nmap.org
nmap -sV --script="not exploit" scanme.nmap.org --除了exploit
nmap -sV --script "(http*) and not (htttp-slowors and http-brute)" --使用http*的脚本但除了htttp-slowors 和http-brute,即除了DOS攻击和暴力破解脚本
nmap -sV --script expliot -d 3 --script-trace scanme.nmap.org --使用expoliot 的同时开启调试模式。-d(debug范围0~9)
nmap -sV -p 443 --script=ssl-heartbleed 192.168.1.0/24 --检测SSL漏洞问题的主机,heartbleed测试。
nmap --script-updatedb --更新NSE
nmap的NSE目录:https://nmap.org/nsedoc/
使用指定网卡进行探测:
nmap -e interface CIDR --可通过ipconfig 获取网卡名称
nmap -iflist --输出主机的网卡接口和路由信息
两次探测结果对比:ndiff.exe,为了监控网络变化。
Reference:
https://www.cnblogs.com/mutudou/archive/2019/10/30/11767182.html
https://nmap.org/man/zh/man-port-scanning-basics.html