Nmap的用法

debian:/# nmap -sP 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:29 CST
Host localhost (10.10.10.136) appears to be up.
Nmap done: 1 IP address (1 host up) scanned in 0.038 seconds
debian:/#
debian:/# nmap -sS 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:08 CST
Interesting ports on 10.10.10.136:
Not shown: 1712 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
111/tcp open  rpcbind

Nmap done: 1 IP address (1 host up) scanned in 13.134 seconds
debian:/# nmap -sT 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:09 CST
Interesting ports on 10.10.10.136:
Not shown: 1712 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
111/tcp open  rpcbind

Nmap done: 1 IP address (1 host up) scanned in 13.165 seconds
debian:/# nmap -sU 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:09 CST
Interesting ports on 10.10.10.136:
Not shown: 1484 closed ports
PORT    STATE         SERVICE
68/udp  open|filtered dhcpc
111/udp open|filtered rpcbind
631/udp open|filtered unknown
883/udp open|filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 14.266 seconds
debian:/# nmap -sF 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:10 CST
Interesting ports on 10.10.10.136:
Not shown: 1712 closed ports
PORT    STATE         SERVICE
22/tcp  open|filtered ssh
80/tcp  open|filtered http
111/tcp open|filtered rpcbind

Nmap done: 1 IP address (1 host up) scanned in 14.432 seconds
debian:/# nmap -sX 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:11 CST
Interesting ports on 10.10.10.136:
Not shown: 1712 closed ports
PORT    STATE         SERVICE
22/tcp  open|filtered ssh
80/tcp  open|filtered http
111/tcp open|filtered rpcbind

Nmap done: 1 IP address (1 host up) scanned in 14.261 seconds
debian:/# nmap -sN 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:11 CST
Interesting ports on 10.10.10.136:
Not shown: 1712 closed ports
PORT    STATE         SERVICE
22/tcp  open|filtered ssh
80/tcp  open|filtered http
111/tcp open|filtered rpcbind

Nmap done: 1 IP address (1 host up) scanned in 14.247 seconds
debian:/# nmap -sI 10.10.10.136
WARNING: Many people use -PN w/Idlescan to prevent pings from their true IP.  On the other hand, timing info Nmap gains from pings can allow for faster, more reliable scans.

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:13 CST
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 2.036 seconds
debian:/# nmap -sI -P0 10.10.10.136
WARNING: Many people use -PN w/Idlescan to prevent pings from their true IP.  On the other hand, timing info Nmap gains from pings can allow for faster, more reliable scans.

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:13 CST
Skipping Idle Scan against 10.10.10.136 -- you can't idle scan your own machine (localhost).
0 ports scanned on 10.10.10.136

Nmap done: 1 IP address (1 host up) scanned in 15.038 seconds
debian:/# nmap -sI -P0 192.168.1.1
WARNING: Many people use -PN w/Idlescan to prevent pings from their true IP.  On the other hand, timing info Nmap gains from pings can allow for faster, more reliable scans.

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:13 CST
Could not resolve idle scan zombie host: -P0
QUITTING!
debian:/# nmap -sA 192.168.1.1

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:14 CST
All 1715 scanned ports on 192.168.1.1 are unfiltered
MAC Address: 00:E0:4C:03:FD:87 (Realtek Semiconductor)

Nmap done: 1 IP address (1 host up) scanned in 14.819 seconds
debian:/# nmap -sS -P0 -O 10.10.10.136

Starting Nmap 4.62 ( http://nmap.org ) at 2009-07-30 14:15 CST
Interesting ports on localhost (10.10.10.136):
Not shown: 1712 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
111/tcp open  rpcbind
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.17 - 2.6.23
Uptime: 0.105 days (since Thu Jul 30 11:44:44 2009)
Network Distance: 0 hops

OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 1.672 seconds
debian:/#


百度名片的说明
进行ping扫描,打印出对扫描做出响应的主机,不做进一步测试(如端口扫描或者操作系统探测):
  nmap -sP 192.168.1.0/24
  仅列出指定网络上的每台主机,不发送任何报文到目标主机:
  nmap -sL 192.168.1.0/24
  探测目标主机开放的端口,可以指定一个以逗号分隔的端口列表(如-PS22,23,25,80):
  nmap -PS 192.168.1.234
  使用UDP ping探测主机:
  nmap -PU 192.168.1.0/24
  使用频率最高的扫描选项:SYN扫描,又称为半开放扫描,它不打开一个完全的TCP连接,执行得很快:
  nmap -sS 192.168.1.0/24
  当SYN扫描不能用时,TCP Connect()扫描就是默认的TCP扫描:
  nmap -sT 192.168.1.0/24
  UDP扫描用-sU选项,UDP扫描发送空的(没有数据)UDP报头到每个目标端口:
  nmap -sU 192.168.1.0/24
  确定目标机支持哪些IP协议 (TCP,ICMP,IGMP等):
  nmap -sO 192.168.1.19
  探测目标主机的操作系统:
  nmap -O 192.168.1.19
  nmap -A 192.168.1.19
  另外,nmap官方文档中的例子:
  nmap -v scanme.
  这个选项扫描主机scanme中 所有的保留TCP端口。选项-v启用细节模式。
  nmap -sS -O scanme./24
  进行秘密SYN扫描,对象为主机Saznme所在的“C类”网段 的255台主机。同时尝试确定每台工作主机的操作系统类型。因为进行SYN扫描 和操作系统检测,这个扫描需要有根权限。
  nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127
  进行主机列举和TCP扫描,对象为B类188.116网段中255个8位子网。这 个测试用于确定系统是否运行了sshd、DNS、imapd或4564端口。如果这些端口 打开,将使用版本检测来确定哪种应用在运行。
  nmap -v -iR 100000 -P0 -p 80
  随机选择100000台主机扫描是否运行Web服务器(80端口)。由起始阶段 发送探测报文来确定主机是否工作非常浪费时间,而且只需探测主机的一个端口,因 此使用-P0禁止对主机列表。
  nmap -P0 -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20
  扫描4096个IP地址,查找Web服务器(不ping),将结果以Grep和XML格式保存。
  host -l | cut -d -f 4 | nmap -v -iL –
  进行DNS区域传输,以发现中的主机,然后将IP地址提供给 Nmap。上述命令用于GNU/Linux — 其它系统进行区域传输时有不同的命令。
  其他选项:
  -p (只扫描指定的端口)
  单个端口和用连字符表示的端口范 围(如 1-1023)都可以。当既扫描TCP端口又扫描UDP端口时,可以通过在端口号前加上T: 或者U:指定协议。 协议限定符一直有效直到指定另一个。 例如,参数 -p U:53,111,137,T:21-25,80,139,8080 将扫描UDP 端口53,111,和137,同时扫描列出的TCP端口。
  -F (快速 (有限的端口) 扫描)

发表评论

电子邮件地址不会被公开。 必填项已用*标注