我将用两个不同的部分来涵盖大部分NMAP的使用方法,这是nmap关键的第一部分。在下面的设置中,我使用两台已关闭防火墙的服务器来测试Nmap命令的工作情况。
- 192.168.0.100–server1.tecmint.com
- 192.168.0.101–server2.tecmint.com
NMAP命令用法
- #nmap[ScanType(s)][Options]{targetspecification}
如何在Linux下安装NMAP
现在大部分Linux的发行版本像Red Hat,CentOS,Fedoro,Debian和Ubuntu在其默认的软件包管理库(即Yum和APT)中都自带了Nmap,这两种工具都用于安装和管理软件包和更新。在发行版上安装Nmap具体使用如下命令。
- #yuminstallnmap[onRedHatbasedsystems]
- $sudoapt-getinstallnmap[onDebianbasedsystems]
一旦你安装了最新的nmap应用程序,你就可以按照本文中提供的示例说明来操作。
1. 用主机名和IP地址扫描系统
Nmap工具提供各种方法来扫描系统。在这个例子中,我使用server2.tecmint.com主机名来扫描系统找出该系统上所有开放的端口,服务和MAC地址。
使用主机名扫描
- [root@server1~]#nmapserver2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1115:42EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.415seconds
- Youhavenewmailin/var/spool/mail/root
使用IP地址扫描
- [root@server1~]#nmap192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1811:04EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 958/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.465seconds
- Youhavenewmailin/var/spool/mail/root
2.扫描使用“-v”选项
你可以看到下面的命令使用“-v“选项后给出了远程机器更详细的信息。
- [root@server1~]#nmap-vserver2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1115:43EST
- InitiatingARPPingScanagainst192.168.0.101[1port]at15:43
- TheARPPingScantook0.01stoscan1totalhosts.
- InitiatingSYNStealthScanagainstserver2.tecmint.com(192.168.0.101)[1680ports]at15:43
- Discoveredopenport22/tcpon192.168.0.101
- Discoveredopenport80/tcpon192.168.0.101
- Discoveredopenport8888/tcpon192.168.0.101
- Discoveredopenport111/tcpon192.168.0.101
- Discoveredopenport3306/tcpon192.168.0.101
- Discoveredopenport957/tcpon192.168.0.101
- TheSYNStealthScantook0.30stoscan1680totalports.
- Hostserver2.tecmint.com(192.168.0.101)appearstobeup...good.
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.485seconds
- Rawpacketssent:1681(73.962KB)|Rcvd:1681(77.322KB)
3.扫描多台主机
你可以简单的在Nmap命令后加上多个IP地址或主机名来扫描多台主机。
- [root@server1~]#nmap192.168.0.101192.168.0.102192.168.0.103
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:06EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:3IPaddresses(1hostup)scannedin0.580seconds
4.扫描整个子网
你可以使用*通配符来扫描整个子网或某个范围的IP地址。
- [root@server1~]#nmap192.168.0.*
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:11EST
- Interestingportsonserver1.tecmint.com(192.168.0.100):
- Notshown:1677closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 111/tcpopenrpcbind
- 851/tcpopenunknown
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:256IPaddresses(2hostsup)scannedin5.550seconds
- Youhavenewmailin/var/spool/mail/root
从上面的输出可以看到,nmap扫描了整个子网,给出了网络中当前网络中在线主机的信息。
5.使用IP地址的最后一个字节扫描多台服务器
你可以简单的指定IP地址的最后一个字节来对多个IP地址进行扫描。例如,我在下面执行中扫描了IP地址192.168.0.101,192.168.0.102和192.168.0.103。
- [root@server1~]#nmap192.168.0.101,102,103
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:09EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:3IPaddresses(1hostup)scannedin0.552seconds
- Youhavenewmailin/var/spool/mail/root
6. 从一个文件中扫描主机列表
如果你有多台主机需要扫描且所有主机信息都写在一个文件中,那么你可以直接让nmap读取该文件来执行扫描,让我们来看看如何做到这一点。
创建一个名为“nmaptest.txt”的文本文件,并定义所有你想要扫描的服务器IP地址或主机名。
- [root@server1~]#cat>nmaptest.txt
- localhost
- server2.tecmint.com
- 192.168.0.101
接下来运行带“iL”选项的nmap命令来扫描文件中列出的所有IP地址。
- [root@server1~]#nmap-iLnmaptest.txt
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1810:58EST
- Interestingportsonlocalhost.localdomain(127.0.0.1):
- Notshown:1675closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 25/tcpopensmtp
- 111/tcpopenrpcbind
- 631/tcpopenipp
- 857/tcpopenunknown
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 958/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 958/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:3IPaddresses(3hostsup)scannedin2.047seconds
7.扫描一个IP地址范围
你可以在nmap执行扫描时指定IP范围。
- [root@server1~]#nmap192.168.0.101-110
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:09EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:10IPaddresses(1hostup)scannedin0.542seconds
8.排除一些远程主机后再扫描
在执行全网扫描或用通配符扫描时你可以使用“-exclude”选项来排除某些你不想要扫描的主机。
- [root@server1~]#nmap192.168.0.*--exclude192.168.0.100
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:16EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:255IPaddresses(1hostup)scannedin5.313seconds
- Youhavenewmailin/var/spool/mail/root
9.扫描操作系统信息和路由跟踪
使用Nmap,你可以检测远程主机上运行的操作系统和版本。为了启用操作系统和版本检测,脚本扫描和路由跟踪功能,我们可以使用NMAP的“-A“选项。
- [root@server1~]#nmap-A192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:25EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICEVERSION
- 22/tcpopensshOpenSSH4.3(protocol2.0)
- 80/tcpopenhttpApachehttpd2.2.3((CentOS))
- 111/tcpopenrpcbind2(rpc#100000)
- 957/tcpopenstatus1(rpc#100024)
- 3306/tcpopenmysqlMySQL(unauthorized)
- 8888/tcpopenhttplighttpd1.4.32
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- NoexactOSmatchesforhost(IfyouknowwhatOSisrunningonit,seehttp://www.insecure.org/cgi-bin/nmap-submit.cgi).
- TCP/IPfingerprint:
- SInfo(V=4.11%P=i686-redhat-linux-gnu%D=11/11%Tm=52814B66%O=22%C=1%M=080027)
- TSeq(Class=TR%IPID=Z%TS=1000HZ)
- T1(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW)
- T2(Resp=N)
- T3(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW)
- T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
- T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
- T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
- T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
- PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
- Uptime0.169days(sinceMonNov1112:22:152013)
- Nmapfinished:1IPaddress(1hostup)scannedin22.271seconds
从上面的输出你可以看到,Nmap显示出了远程主机操作系统的TCP/IP协议指纹,并且更加具体的显示出远程主机上的端口和服务。
10.启用Nmap的操作系统探测功能
使用选项“-O”和“-osscan-guess”也帮助探测操作系统信息。
- [root@server1~]#nmap-Oserver2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:40EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- NoexactOSmatchesforhost(IfyouknowwhatOSisrunningonit,seehttp://www.insecure.org/cgi-bin/nmap-submit.cgi).
- TCP/IPfingerprint:
- SInfo(V=4.11%P=i686-redhat-linux-gnu%D=11/11%Tm=52815CF4%O=22%C=1%M=080027)
- TSeq(Class=TR%IPID=Z%TS=1000HZ)
- T1(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW)
- T2(Resp=N)
- T3(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW)
- T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=Option-Oand-osscan-guessalsohelpstodiscoverOS
- R%Ops=)
- T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
- T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
- T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
- PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
- Uptime0.221days(sinceMonNov1112:22:162013)
- Nmapfinished:1IPaddress(1hostup)scannedin11.064seconds
- Youhavenewmailin/var/spool/mail/root
11.扫描主机侦测防火墙
下面的命令将扫描远程主机以探测该主机是否使用了包过滤器或防火墙。
- [root@server1~]#nmap-sA192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:27EST
- All1680scannedportsonserver2.tecmint.com(192.168.0.101)areUNfiltered
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.382seconds
- Youhavenewmailin/var/spool/mail/root
12.扫描主机检测是否有防火墙保护
扫描主机检测其是否受到数据包过滤软件或防火墙的保护。
- [root@server1~]#nmap-PN192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:30EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.399seconds
13.找出网络中的在线主机
使用“-sP”选项,我们可以简单的检测网络中有哪些在线主机,该选项会跳过端口扫描和其他一些检测。
- [root@server1~]#nmap-sP192.168.0.*
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1811:01EST
- Hostserver1.tecmint.com(192.168.0.100)appearstobeup.
- Hostserver2.tecmint.com(192.168.0.101)appearstobeup.
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:256IPaddresses(2hostsup)scannedin5.109seconds
14.执行快速扫描
你可以使用“-F”选项执行一次快速扫描,仅扫描列在nmap-services文件中的端口而避开所有其它的端口。
- [root@server1~]#nmap-F192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:47EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1234closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.322seconds
15.查看Nmap的版本
你可以使用“-V”选项来检测你机子上Nmap的版本。
- [root@server1~]#nmap-V
- Nmapversion4.11(http://www.insecure.org/nmap/)
- Youhavenewmailin/var/spool/mail/root
16.顺序扫描端口
使用“-r”选项表示不会随机的选择端口扫描。
- [root@server1~]#nmap-r192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1116:52EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.363seconds
17.打印主机接口和路由
你可以使用nmap的“–iflist”选项检测主机接口和路由信息。
- [root@server1~]#nmap--iflist
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:07EST
- ************************INTERFACES************************
- DEV(SHORT)IP/MASKTYPEUPMAC
- lo(lo)127.0.0.1/8loopbackup
- eth0(eth0)192.168.0.100/24ethernetup08:00:27:11:C7:89
- **************************ROUTES**************************
- DST/MASKDEVGATEWAY
- 192.168.0.0/0eth0
- 169.254.0.0/0eth0
从上面的输出你可以看到,nmap列举出了你系统上的接口以及它们各自的路由信息。
18.扫描特定的端口
使用Nmap扫描远程机器的端口有各种选项,你可以使用“-P”选项指定你想要扫描的端口,默认情况下nmap只扫描TCP端口。
- [root@server1~]#nmap-p80server2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:12EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 80/tcpopenhttp
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)sca
19.扫描TCP端口
你可以指定具体的端口类型和端口号来让nmap扫描。
- [root@server1~]#nmap-pT:8888,80server2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:15EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 80/tcpopenhttp
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.157seconds
20.扫描UDP端口
- [root@server1~]#nmap-sU53server2.tecmint.com
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:15EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 53/udpopenhttp
- 8888/udpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.157seconds
21.扫描多个端口
你还可以使用选项“-P”来扫描多个端口。
- [root@server1~]#nmap-p80,443192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1810:56EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 80/tcpopenhttp
- 443/tcpclosedhttps
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.190seconds
22.扫描指定范围内的端口
您可以使用表达式来扫描某个范围内的端口。
- [root@server1~]#nmap-p80-160192.168.0.101
23.查找主机服务版本号
我们可以使用“-sV”选项找出远程主机上运行的服务版本。
- [root@server1~]#nmap-sV192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:48EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICEVERSION
- 22/tcpopensshOpenSSH4.3(protocol2.0)
- 80/tcpopenhttpApachehttpd2.2.3((CentOS))
- 111/tcpopenrpcbind2(rpc#100000)
- 957/tcpopenstatus1(rpc#100024)
- 3306/tcpopenmysqlMySQL(unauthorized)
- 8888/tcpopenhttplighttpd1.4.32
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin12.624seconds
24.使用TCP ACK (PA)和TCP Syn (PS)扫描远程主机
有时候包过滤防火墙会阻断标准的ICMPping请求,在这种情况下,我们可以使用TCP ACK和TCP Syn方法来扫描远程主机。
- [root@server1~]#nmap-PS192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1117:51EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.360seconds
- Youhavenewmailin/var/spool/mail/root
25.使用TCP ACK扫描远程主机上特定的端口
- [root@server1~]#nmap-PA-p22,80192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1118:02EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.166seconds
- Youhavenewmailin/var/spool/mail/root
26.使用TCP Syn扫描远程主机上特定的端口
- [root@server1~]#nmap-PS-p22,80192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1118:08EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.165seconds
- Youhavenewmailin/var/spool/mail/root
27.执行一次隐蔽的扫描
- [root@server1~]#nmap-sS192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1118:10EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.383seconds
- Youhavenewmailin/var/spool/mail/root
28.使用TCP Syn扫描最常用的端口
- [root@server1~]#nmap-sT192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1118:12EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopenssh
- 80/tcpopenhttp
- 111/tcpopenrpcbind
- 957/tcpopenunknown
- 3306/tcpopenmysql
- 8888/tcpopensun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin0.406seconds
- Youhavenewmailin/var/spool/mail/root
29.执行TCP空扫描以骗过防火墙
- [root@server1~]#nmap-sN192.168.0.101
- StartingNmap4.11(http://www.insecure.org/nmap/)at2013-11-1119:01EST
- Interestingportsonserver2.tecmint.com(192.168.0.101):
- Notshown:1674closedports
- PORTSTATESERVICE
- 22/tcpopen|filteredssh
- 80/tcpopen|filteredhttp
- 111/tcpopen|filteredrpcbind
- 957/tcpopen|filteredunknown
- 3306/tcpopen|filteredmysql
- 8888/tcpopen|filteredsun-answerbook
- MACAddress:08:00:27:D9:8E:D7(CadmusComputerSystems)
- Nmapfinished:1IPaddress(1hostup)scannedin1.584seconds
- Youhavenewmailin/var/spool/mail/root
以上就是NMAP的基本使用,我会在第二部分带来NMAP更多的创意选项。至此,敬请关注我们,不要忘记分享您的宝贵意见。