nmap实例

2013-06-06

Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts.

Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

nmap — Network exploration tool and security / port scanner

1、简单扫描
nmap -sS 192.168.1.1
2、扫描网段指定端口
nmap -v -sS 192.168.1.0/24 -p 80|grep open
nmap -v -sS 192.168.1.10-120 -p 80|grep open

3、扫描OS及版本
nmap -O 192.168.1.1
nmap -sV 192.168.1.1

4、指定扫描方式
01. -sS/sT/sA/sW/sM:指定使用 TCP SYN/Connect()/ACK/Window/Maimon scans的方式来对目标主机进行扫描。
02. -sU: 指定使用UDP扫描方式确定目标主机的UDP端口状况。
03. -sN/sF/sX: 指定使用TCP Null, FIN, and Xmas scans秘密扫描方式来协助探测对方的TCP端口状态。
04. --scanflags : 定制TCP包的flags。
05. -sI : 指定使用idle scan方式来扫描目标主机(前提需要找到合适的zombie host)
06. -sY/sZ: 使用SCTP INIT/COOKIE-ECHO来扫描SCTP协议端口的开放的情况。
07. -sO: 使用IP protocol 扫描确定目标机支持的协议类型。
08. -b : 使用FTP bounce scan扫描方式

5、Nmap的优点:
01. 灵活。支持数十种不同的扫描方式,支持多种目标对象的扫描。
02. 强大。Nmap可以用于扫描互联网上大规模的计算机。
03. 可移植。支持主流操作系统:Windows/Linux/Unix/MacOS等等;源码开放,方便移植。
04. 简单。提供默认的操作能覆盖大部分功能,基本端口扫描nmap targetip,全面的扫描nmap –A targetip。
05. 自由。Nmap作为开源软件,在GPL License的范围内可以自由的使用。
06. 文档丰富。Nmap官网提供了详细的文档描述。Nmap作者及其他安全专家编写了多部Nmap参考书籍。
07. 社区支持。Nmap背后有强大的社区团队支持。
08. 赞誉有加。获得很多的奖励,并在很多影视作品中出现(如黑客帝国2、Die Hard4等)。
09. 流行。目前Nmap已经被成千上万的安全专家列为必备的工具之一。

6、Nmap Scripting Engine(NSE)是Nmap非常重要的特性,它允许用户使用Lua语言编写简单的脚本程序来实现各种网络管理任务的自动化运行。目前Nmap已提供超过340个脚本(script路径).

nmap --script http-auth.nse target
nmap -sC http-auth.nse target(执行default category中的所有脚本)

参考网站:
http://nmap.org/
http://nmap.org/docs.html

分类:安全 | 标签: |

相关日志

评论被关闭!