在Linux系统中nmap扫描工具的使用


nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端。确定哪些服务运行在哪些连接端,并且推断计算机运行哪个操作系统。它是网络管理员必用的软件之一,以及用以评估网络系统安全。在工作中常用的nmap命令如下:

1.安装nmap软件
[root@CentOS yum.repos.d]# yum install nmap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nmap.i686 2:5.51-2.el6 will be installed
--> Processing Dependency: libpcap.so.1 for package: 2:nmap-5.51-2.el6.i686
--> Running transaction check
---> Package libpcap.i686 14:1.0.0-6.20091201git117cb5.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package                Arch                Version                                            Repository              Size
=============================================================================================================================
Installing:
nmap                  i686                2:5.51-2.el6                                      c6-media                2.7 M
Installing for dependencies:
libpcap                i686                14:1.0.0-6.20091201git117cb5.el6                  c6-media                125 k
Transaction Summary
=============================================================================================================================
Install      2 Package(s)
Total download size: 2.9 M
Installed size: 10 M
Is this ok [y/N]: y    --确定安装

2.常用选项
          -sT            --TCP协议扫描
          -sS          --TCP同步扫描
          -sP          --用Ping检测主机是否在运行
          -sU          --UDP端口扫描
          -sA          --可以穿透防火墙规则集
          -v            --扫描过程有详细信息
          -p 端口范围  --扫描指定的端口范围
          -iL 文件      --可以从文件中读取目标
          -oN            --将扫描的结果重写向到文件中

3.工具的使用
[root@centos /]# nmap  -sP 192.168.1.0/24    --查看有多少主机在
[root@centos /]# nmap -sT 192.168.1.23  --扫描指定的主机TCP端口
[root@centos /]# nmap -sS 192.168.1.23    --SYN扫描IP的tcp和udp端口(速度快)
[root@centos /]# nmap -O 192.168.1.23    --查看IP对应的操作系统
[root@centos /]# nmap -A 192.168.1.23    --查看IP对应的详细操作系统
[root@centos /]# nmap -sA 192.168.1.23  --ACK扫描可穿透防火墙
[root@centos /]# nmap -PS 192.168.1.23  --查看目标主机开放的端口
[root@centos /]# nmap -PS -p 21,22,3306 2.2.2.1-100  --查看指定的IP和指定的端口

Linux下的端口扫描工具nmap

nmap详解--网络扫描和嗅探工具包

nmap应用技巧

RedHat Enterprise Linux 5 下nmap的一次曲折安装

Linux中让nmap命令跟防火墙捉迷藏

相关内容