批量主机服务扫描

阅读更多
一 目的
1、批量主机存活扫描
2、针对主机服务扫描
 
二 作用
1、能更方便快捷获取网络中主机的存活状态。
2、更加细致、智能获取主机服务侦查情况。
 
三 典型命令
nmap、ncat
 
四 nmap介绍

批量主机服务扫描_第1张图片
 
 
五 namp安装
[root@localhost hping-master]# yum install -y nmap
[root@localhost hping-master]# whereis nmap
nmap: /usr/bin/nmap /usr/share/nmap /usr/share/man/man1/nmap.1.gz
 
六 实战
1、扫描主机存活
[root@localhost hping-master]# nmap -sP 10.224.21.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2017-08-13 14:02 CST
Nmap scan report for 10.224.21.1
Host is up (0.0045s latency).
Nmap scan report for 10.224.21.2
Host is up (0.0041s latency).
Nmap scan report for 10.224.21.3
Host is up (0.0031s latency).
Nmap scan report for 10.224.21.5
Host is up (0.0037s latency).
Nmap scan report for 10.224.21.6
Host is up (0.0037s latency).
Nmap scan report for 10.224.21.7
Host is up (0.0037s latency).
Nmap scan report for 10.224.21.9
Host is up (0.0044s latency).
Nmap scan report for 10.224.21.10
Host is up (0.0047s latency).
Nmap scan report for 10.224.21.11
Host is up (0.0035s latency).
Nmap scan report for 10.224.21.13
Host is up (0.0036s latency).
Nmap scan report for 10.224.21.14
Host is up (0.0033s latency).
Nmap scan report for 10.224.21.15
Host is up (0.0054s latency).
Nmap scan report for 10.224.21.17
Host is up (0.0054s latency).
Nmap scan report for 10.224.21.18
Host is up (0.0036s latency).
Nmap scan report for 10.224.21.19
Host is up (0.0050s latency).
Nmap scan report for 10.224.21.21
Host is up (0.0069s latency).
Nmap scan report for 10.224.21.22
Host is up (0.0038s latency).
Nmap scan report for 10.224.21.23
Host is up (0.025s latency).
Nmap scan report for 10.224.21.25
Host is up (0.0031s latency).
Nmap scan report for 10.224.21.26
Host is up (0.0033s latency).
Nmap scan report for 10.224.21.27
Host is up (0.0051s latency).
Nmap done: 256 IP addresses (21 hosts up) scanned in 32.70 seconds
2、利用TCP半连接侦测某台主机的服务存活状态
[root@localhost hping-master]# nmap -sS 117.34.35.1
 
Starting Nmap 6.40 ( http://nmap.org ) at 2017-08-13 14:08 CST
Nmap scan report for 117.34.35.1
Host is up (0.012s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
445/tcp filtered microsoft-ds
 
Nmap done: 1 IP address (1 host up) scanned in 7.99 seconds
3、指定端口范围扫描
[root@localhost hping-master]# nmap -sS -p 0-30000 117.34.35.1
 
Starting Nmap 6.40 ( http://nmap.org ) at 2017-08-13 14:13 CST
Nmap scan report for 117.34.35.1
Host is up (0.0059s latency).
Not shown: 29998 closed ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
445/tcp filtered microsoft-ds
 
Nmap done: 1 IP address (1 host up) scanned in 253.00 seconds
4、利用TCP全连接侦测某台主机的服务存活状态
[root@localhost ~]# nmap -sT 117.34.35.1
 
Starting Nmap 6.40 ( http://nmap.org ) at 2017-08-13 14:16 CST
Nmap scan report for 117.34.35.1
Host is up (0.0064s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
80/tcp open http
443/tcp open https
445/tcp filtered microsoft-ds
 
Nmap done: 1 IP address (1 host up) scanned in 1.54 seconds
5、基于UDP扫描,会比较慢
[root@localhost ~]# nmap -sU 117.34.35.1
 
Starting Nmap 6.40 ( http://nmap.org ) at 2017-08-13 14:22 CST
Nmap scan report for 117.34.35.1
Host is up (0.0053s latency).
Not shown: 996 closed ports
PORT STATE SERVICE
67/udp open|filtered dhcps
68/udp open|filtered dhcpc
161/udp open snmp
520/udp open|filtered route
 
Nmap done: 1 IP address (1 host up) scanned in 1075.15 seconds

 
  • 批量主机服务扫描_第2张图片
  • 大小: 189 KB
  • 查看图片附件

你可能感兴趣的:(主机服务扫描)