Nmap is very popular tool among pentester and system/network administrators. We have all ready provided different nmap tutorials and cheat sheet but TCP and UDP port scan is important part of the scan. We will dive in detail in this tutorial.
Nmap是在pentester和系统/网络管理员中非常流行的工具。 我们已经准备好提供不同的nmap教程和备忘单,但是TCP和UDP端口扫描是扫描的重要部分。 我们将在本教程中详细介绍。
开始端口扫描 (Start Port Scan)
The most simple usage without any parameter for a port scan is just providing the target. The target can be a single IP or hostname or multiple targets. In this example we will scan IP address 192.168.1.1
with most common 1000 ports by default.
没有任何参数进行端口扫描的最简单用法就是提供目标。 目标可以是单个IP或主机名,也可以是多个目标。 在此示例中,默认情况下,我们将使用最常见的1000个端口扫描IP地址192.168.1.1
。
$ nmap 192.168.1.1
![Start Port Scan](https://i-blog.csdnimg.cn/blog_migrate/3e6335fde7bfe1e0e6b246f3006e77af.png)
TCP同步扫描(TCP Syn Scan)
As we know TCP connection is initiated with 3-way handshake. The first step in 3-way handshake is sending Syn
TCP packets. We can only send Syn
packets to the target to scan and get status of the remote port without establishing connection. We will use -sS
for this. This option requires Administrator or root privileges
众所周知,TCP连接是通过3次握手来启动的。 三向握手的第一步是发送Syn
TCP数据包。 我们只能在不建立连接的情况下将Syn
数据包发送到目标进行扫描并获取远程端口的状态。 我们将为此使用-sS
。 此选项需要管理员或root特权
$ nmap -sS 192.168.1.1
![TCP Syn Scan](https://i-blog.csdnimg.cn/blog_migrate/41a45559e592b8ae53cd98c59318d3d2.png)