Nmap is a very useful and popular tool used to scan ports. Nmap by default scans the most popular 1000 ports. We may need to change the port range and protocol type to all while scanning with Nmap.

Nmap是用于扫描端口的非常有用且流行的工具。 默认情况下,Nmap扫描最流行的1000个端口。 使用Nmap扫描时,我们可能需要将端口范围和协议类型全部更改。

扫描具有范围的所有TCP端口 (Scan All TCP Ports with Range)

We can specify the port range with the -p option. As we know TCP port numbers are between  and 65535  . We will use -p0-65535 as an option in order to scan all TCP ports. We do not specify the TCP protocol because the default protocol for Nmap port scan is TCP.

我们可以使用-p选项指定端口范围。 我们知道TCP端口号介于和65535 。 我们将使用-p0-65535作为选项,以扫描所有TCP端口。 我们未指定TCP协议,因为Nmap端口扫描的默认协议为TCP。

$ nmap -p0-65535 192.168.122.1

更快扫描所有端口 (Faster Scan For All Ports)

If we are scanning all ports this will take a lot of time. If the situation is not critical we can use a faster scan with -T5 parameter. This is the fastest scan level for Nmap. This option can be used for UDP scans too.

如果我们要扫描所有端口,则将花费大量时间。 如果情况不是很紧急,我们可以使用带有-T5参数的更快扫描。 这是Nmap最快的扫描级别。 此选项也可用于UDP扫描。

$ nmap  -p0-65535 192.168.122.1 -T5

Faster Scan For All Ports
更快扫描所有端口

扫描所有TCP端口(Scan All TCP Ports)

Another way to specify all TCP ports is a dash. We can use -p- which is more practical then port range specification.

指定所有TCP端口的另一种方法是破折号。 我们可以使用-p- ,它比端口范围规范更实用。

$ nmap -p- 192.168.122.1

扫描具有范围的所有UDP端口 (Scan All UDP Ports with Range)

Nmap uses TCP as the default protocol for the port scan. We should explicitly specify the UDP protocol for the UDP port scan. We will use the same port range specification used in TCP. We will use -sU for UDP protocol specification.

Nmap使用TCP作为端口扫描的默认协议。 我们应该为UDP端口扫描明确指定UDP协议。 我们将使用与TCP相同的端口范围规范。 我们将-sU用于UDP协议规范。

$ nmap -sU -p0-65535 192.168.122.1

扫描所有UDP端口 (Scan All UDP Ports)

We can also scan all UDP ports by using the -sU option. We will use -p- to specify all ports easily. -p- express all ports from 0 to 65535. UDP scan is slow and takes some time to complete.

我们还可以使用-sU选项扫描所有UDP端口。 我们将使用-p-轻松指定所有端口。 -p-表示从0到65535的所有端口。UDP扫描速度很慢,需要一些时间才能完成。

$ nmap -sU -p- 192.168.122.1

扫描所有TCP UDP端口 (Scan All TCP UDP Ports)

We can scan all UDP and TCP ports in a single command. We will use -sU for UDP and sT for TCP protocol. We will also specify the port range we want to scan which is all TCP and UDP ports that start from 0 to 65535. This will scan all 65535 ports of TCP and UDP for the specified remote host or IP address. Keep in mind that this will take some time because especially UDP scan is slow according to the TCP scan. We will also provide root privileges with the sudo command.

我们可以在一个命令中扫描所有UDP和TCP端口。 我们将-sU用于UDP,将sT用于TCP协议。 我们还将指定要扫描的端口范围,即从0到65535开始的所有TCP和UDP端口。这将扫描TCP和UDP的所有65535端口以查找指定的远程主机或IP地址。 请记住,这会花费一些时间,因为根据TCP扫描,尤其是UDP扫描速度很慢。 我们还将通过sudo命令提供root特权。

$ sudo nmap -sU -sT -p0-65535 192.168.122.1
.ub70da9c7864ee1491749ecd93179cfab , .ub70da9c7864ee1491749ecd93179cfab .postImageUrl , .ub70da9c7864ee1491749ecd93179cfab .centered-text-area { min-height: 80px; position: relative; } .ub70da9c7864ee1491749ecd93179cfab , .ub70da9c7864ee1491749ecd93179cfab:hover , .ub70da9c7864ee1491749ecd93179cfab:visited , .ub70da9c7864ee1491749ecd93179cfab:active { border:0!important; } .ub70da9c7864ee1491749ecd93179cfab .clearfix:after { content: ""; display: table; clear: both; } .ub70da9c7864ee1491749ecd93179cfab { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ub70da9c7864ee1491749ecd93179cfab:active , .ub70da9c7864ee1491749ecd93179cfab:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ub70da9c7864ee1491749ecd93179cfab .centered-text-area { width: 100%; position: relative; } .ub70da9c7864ee1491749ecd93179cfab .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ub70da9c7864ee1491749ecd93179cfab .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ub70da9c7864ee1491749ecd93179cfab .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ub70da9c7864ee1491749ecd93179cfab:hover .ctaButton { background-color: #E67E22!important; } .ub70da9c7864ee1491749ecd93179cfab .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ub70da9c7864ee1491749ecd93179cfab .ub70da9c7864ee1491749ecd93179cfab-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ub70da9c7864ee1491749ecd93179cfab:after { content: ""; display: block; clear: both; }

LEARN MORE  What Is NAT (Network Address Translation) and How It Works?

.ub70da9c7864ee1491749ecd93179cfab , .ub70da9c7864ee1491749ecd93179cfab .postImageUrl , .ub70da9c7864ee1491749ecd93179cfab .centered-text-area { min-height: 80px; position: relative; } .ub70da9c7864ee1491749ecd93179cfab , .ub70da9c7864ee1491749ecd93179cfab:hover , .ub70da9c7864ee1491749ecd93179cfab:visited , .ub70da9c7864ee1491749ecd93179cfab:active { border:0!important; } .ub70da9c7864ee1491749ecd93179cfab .clearfix:after { content: ""; display: table; clear: both; } .ub70da9c7864ee1491749ecd93179cfab { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .ub70da9c7864ee1491749ecd93179cfab:active , .ub70da9c7864ee1491749ecd93179cfab:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .ub70da9c7864ee1491749ecd93179cfab .centered-text-area { width: 100%; position: relative; } .ub70da9c7864ee1491749ecd93179cfab .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .ub70da9c7864ee1491749ecd93179cfab .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .ub70da9c7864ee1491749ecd93179cfab .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .ub70da9c7864ee1491749ecd93179cfab:hover .ctaButton { background-color: #E67E22!important; } .ub70da9c7864ee1491749ecd93179cfab .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .ub70da9c7864ee1491749ecd93179cfab .ub70da9c7864ee1491749ecd93179cfab-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .ub70da9c7864ee1491749ecd93179cfab:after { content: ""; display: block; clear: both; }

了解更多NAT(网络地址转换)是什么以及它如何工作?

翻译自: https://www.poftut.com/how-to-scan-all-tcp-and-udp-ports-with-nmap/

如何使用Nmap扫描所有TCP和UDP端口?相关推荐

  1. 使用 Nmap 扫描 TCP 和 UDP 端口

    Nmap 是渗透测试人员和系统/网络管理员中非常流行的工具.我们已经准备好提供不同的 nmap 教程和备忘单,但 TCP 和 UDP 端口扫描是扫描的重要部分.我们将在本教程中详细介绍. 开始端口扫描 ...

  2. 测试tcp和udp端口连通性

    测试tcp和udp端口连通性 测试tcp和udp端口连通性 tcp端口 命令 telnet udp端口 命令 nc nc命令用法 nc命令man帮助示例 nc默认tcp协议,使用udp要指定u 测试t ...

  3. Apple 软件产品使用的 TCP 和 UDP 端口

    了解 Apple 产品(如 macOS.macOS 服务器."Apple 远程桌面"和 iCloud)使用的 TCP 和 UDP 端口.其中的很多端口都是大家熟知的行业标准端口. ...

  4. Linux工作笔记-查看tcp与udp端口并对比Windows简单分析

    Linux查看端口: -t : 指明显示TCP端口 -u : 指明显示UDP端口 -l : 仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序) -p : ...

  5. 端口 0-65536 TCP和UDP端口的区别

    1.端口只有0-65535. 这个跟TCP.UDP无关. 2.TCP/UDP有独立的端口空间.比如某个应用使用了TCP的1000端口,另一个也可以使用UDP的1000端口,相互独立. 3.UDP,TC ...

  6. tcp和udp端口测试连通性

    服务器临时监听udp端口 nc -l 8081 在别的终端测试连接端口 telnet ip 8081nc -vz ip 8081 服务器临时监听udp端口 nc -lu 8081 在别的终端测试连接端 ...

  7. nmap扫描mysql的命令_端口扫描命令nmap

    下面教大家在CentOS中用nmap查看主机端口: 一.安装nmap yum install nmap -y 二.使用nmap nmap localhost    #查看主机当前开放的端口 nmap ...

  8. php websocket udp,swoole创建websocket服务并且支持https服务,同时监听tcp,udp端口

    namespace serve\websocket; // use serve\websocket\task\Message as taskMessage; use serve\websocket\c ...

  9. NMAP扫描个人电脑扫不到端口分析

    nmap是当前最受欢迎的网络扫描工具之一,其强大的端口探测能力给网络安全工作人员带来了极大的遍历.但是当我们扫描个人电脑时,发现是这样的情况: namp检测到了我们的个人电脑,但没有给我们任何端口以及 ...

最新文章

  1. J2EE 中的服务器 tomcat6.0 配置
  2. 测试机房质量之上传下载速率测试
  3. 跨站请求伪造(CSRF)-简述
  4. 产品诞生过程--导图
  5. 已成功拿下字节、腾讯、脉脉offer,算法太TM重要了
  6. C#拾遗系列(5):泛型委托
  7. 通过shell脚本防止端口扫描
  8. 大数据该挖掘,主要挖掘什么,什么是文本挖掘?
  9. 解决Mac电脑无法读写ntfs硬盘分区的方法以及磁盘读写的简单方法
  10. C++大写字母转小写字母
  11. Respon.WriteFile 下载文件
  12. 网络安全威胁检测与威胁溯源_网络安全威胁2017 –如何保护您的网站
  13. 【进阶5-1期】重新认识构造函数、原型和原型链
  14. Vue 项目的成功发布和部署
  15. 2020年4月5日总结
  16. 使用 Google Fonts 为网页添加美观字体
  17. 桌面添加视疲劳缓解图
  18. openocd调试Linux内核,openocd安装与调试
  19. XS7320 国产高性能IPC
  20. 有什么软件可以测试自己性格,怎样测试自己的性格

热门文章

  1. 第十八章 过去时态和完成时态一般过去时
  2. 强制关机后进不了系统
  3. 展锐UDX710:TTS SDK移植
  4. Mac 移动硬盘突然自己异常退出了(一)
  5. 任意斜率的中点画线算法
  6. 学java的就业方向_学java可以从事哪些方面的工作?java专业就业方向有哪些?
  7. TB,GB,MB,KB,Byte字节,bit位 如何换算?
  8. live2d内嵌html,为你的博客博客/网页添加Live2d二次元老婆的插件/手动方法
  9. 麒麟系统安装CANN开发环境
  10. 自制拖把机器人_懒出新境界:可以自己洗拖布的机器人