端口掃描
NMAP是一個強大的端口掃描類安全評測工具
1.安裝NMAP軟體包
2.掃描文法及類型
掃描目标可以是主機名,ip位址或者網絡位址
常用掃描類型
-sS,TCP SYN掃描(半開掃描)
-sT,TCP連接配接掃描
-sF,TCP FIN掃描
-sU,UDP掃描
-sP,ICMP掃描
-P0,跳過ping檢測
-p,指定掃描的端口
3.掃描操作
掃描TCP端口
[[email protected] ~]# nmap 127.0.0.1 //掃描TCP端口
Starting Nmap 6.40 ( http://nmap.org ) at 2021-05-17 14:49 CST
Nmap scan report for www.wangdi.com (127.0.0.1)
Host is up (0.000011s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
23/tcp open telnet
80/tcp open http
111/tcp open rpcbind
631/tcp open ipp
Nmap done: 1 IP address (1 host up) scanned in 1.61 seconds
[[email protected] ~]#
掃描UDP端口
[[email protected] ~]# nmap -sU 127.0.0.1 //掃描UDP端口
Starting Nmap 6.40 ( http://nmap.org ) at 2021-05-17 14:50 CST
Nmap scan report for www.wangdi.com (127.0.0.1)
Host is up (0.0000040s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
111/udp open rpcbind
5353/udp open|filtered zeroconf
Nmap done: 1 IP address (1 host up) scanned in 2.71 seconds
[[email protected] ~]#
檢測網段内有哪些主機存活
[[email protected] ~]# nmap -n -sP 192.168.177.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2021-05-17 15:32 CST
Nmap scan report for 192.168.177.1
Host is up (0.00022s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.177.2
Host is up (0.00011s latency).
MAC Address: 00:50:56:E6:24:07 (VMware)
Nmap scan report for 192.168.177.3
Host is up.
Nmap done: 256 IP addresses (3 hosts up) scanned in 2.04 seconds
[[email protected] ~]#