tcp/ip协议中的端口_如何在Windows中检查打开的TCP / IP端口

tcp/ip协议中的端口

tcp/ip协议中的端口

Whenever an application wants to make itself accessible over the network, it claims a TCP/IP port, which means that port can’t be used by anything else. So how do you check open ports to see what application is already using it?

每当应用程序想要使其自身可以通过网络访问时,它都会声明一个TCP / IP端口,这意味着该端口不能被任何其他端口使用。 那么,如何检查打开的端口以查看哪些应用程序已经在使用它呢?

An IP address specifies a computer—or other network device—on a network. When one device sends traffic to another, the IP address is used to route that traffic to the appropriate place. Once the traffic reaches the right place, the device needs to know which app or service to send the traffic on to. That’s where ports come in. If the IP address is akin to a street address on a piece of mail, the port is something like the name of the person at that residence who gets the mail. For the most part, you don’t need to worry about ports. But once in a while, you might encounter an app that’s set to listen for traffic on the same port that another app already has in use. In that case, you’ll need to identify the app that already has that port in use.

IP地址指定网络上的计算机或其他网络设备。 当一台设备向另一台设备发送流量时,该IP地址用于将该流量路由到适当的位置。 一旦流量到达正确的位置,设备就需要知道将流量发送到哪个应用程序或服务。 那就是端口的入口。如果IP地址类似于一封邮件上的街道地址,则该端口就像是收到邮件的住所的人的名字。 在大多数情况下,您无需担心端口。 但是有时,您可能会遇到一个应用程序,该应用程序设置为侦听另一个应用程序已在使用的同一端口上的流量。 在这种情况下,您需要确定已使用该端口的应用程序。

There are a number of ways to tell what application has a port locked, but we’re going to walk you through a couple of built-in ways that use the Command Prompt, and then show you a great freeware application that makes it even easier. All these methods should work no matter which version of Windows you use.

有很多方法可以告诉哪个应用程序已锁定端口,但是我们将通过几种内置的使用命令提示符的方法向您介绍,然后向您展示一个出色的免费软件应用程序,该应用程序将使其变得更加容易。 无论使用哪种版本的Windows,所有这些方法都应起作用。

使用内置工具查看正在侦听端口的内容 (Use Built-In Tools to See What is Listening on a Port)

We’ve got two commands to show you. The first lists active ports along with the name of the process that’s using them. Most of the time, that command will work fine. Sometimes, though, the process name won’t help you identify what app or service actually has a port tied up. For those times, you’ll need to list active ports along with their process identifier numbers and then look those processes up in Task Manager.

我们有两个命令向您显示。 第一个列出了活动端口以及正在使用它们的进程的名称。 在大多数情况下,该命令会正常运行。 但是,有时,进程名称并不能帮助您确定实际绑定了哪个应用程序或服务的端口。 在那些时候,您需要列出活动端口及其进程标识符号,然后在任务管理器中查找这些进程。

选项一:查看端口使用以及进程名称 (Option One: View Port Use Along with Process Names)

First, you’ll need to open the Command Prompt in administrator mode. Hit Start, and then type “command” into the search box. When you see “Command Prompt” appear in the results, right-click it and choose “Run as administrator.”

首先,您需要在管理员模式下打开命令提示符。 单击开始,然后在搜索框中键入“命令”。 当结果中显示“命令提示符”时,右键单击它,然后选择“以管理员身份运行”。

At the Command Prompt, type the following text and then hit Enter:

在命令提示符处,键入以下文本,然后按Enter:

netstat -ab

After you hit Enter, the results may take a minute or two to fully display, so be patient. Scroll through the list to find the port (which is listed after the colon to the right of the local IP address), and you’ll see the process name listed under that line. If you’d like to make things a little easier, remember that you can also pipe the results of the command to a text file. You could then just search the text file for the port number you’re after.

按下Enter键后,结果可能需要一两分钟才能完全显示出来,因此请耐心等待。 滚动列表以查找端口(该端口在本地IP地址右侧的冒号后面列出),然后您将在该行下看到进程名称。 如果您想使事情变得简单一些,请记住,您也可以将命令的结果传递给文本文件。 然后,您可以只在文本文件中搜索所需的端口号。

Here, for example, you can see that port 49902 is tied up by a process named picpick.exe. PicPick is an image editor on our system, so we can assume the port is actually tied up by the process that regularly checks for updates to the app.

例如,在这里,您可以看到端口49902被名为picpick.exe的进程占用。 PicPick是我们系统上的图像编辑器,因此我们可以假定端口实际上被定期检查应用程序更新的过程所占用。

选项二:查看端口使用以及进程标识符 (Option Two: View Port Use Along with Process Identifiers)

If the name of the process for the port number you’re looking up makes it difficult to tell what the related app is, you can try a version of the command that shows process identifiers (PIDs) rather than names. Type the following text at the Command Prompt, and then hit Enter:

如果您要查找的端口号的进程名称很难分辨相关的应用程序,则可以尝试使用显示进程标识符(PID)而不是名称的命令版本。 在命令提示符处键入以下文本,然后按Enter:

netstat -aon

The column at the far right lists PIDs, so just find the one that’s bound to the port that you’re trying to troubleshoot.

最右边的列列出了PID,因此只需找到绑定到您要进行故障排除的端口的PID。

Next, open up Task Manager by right-clicking any open space on your taskbar and choosing “Task Manager.”

接下来,右键单击任务栏上的任何空白区域并选择“任务管理器”,以打开任务管理器。

If you’re using Windows 8 or 10, switch to the “Details” tab in Task Manager. In older versions of Windows, you’ll see this information on the “Processes” tab. Sort the list of process by the “PID” column and find the PID associated with the port you’re investigating. You might be able to tell more about what app or service has the port tied up by looking at the “Description” column.

如果您使用的是Windows 8或10,请切换到任务管理器中的“详细信息”选项卡。 在旧版Windows中,您将在“进程”选项卡上看到此信息。 通过“ PID”列对进程列表进行排序,然后找到与您正在研究的端口关联的PID。 您可以通过查看“说明”列来了解有关端口捆绑了哪些应用程序或服务的更多信息。

If not, right-click the process and choose “Open file location.” The location of the file will likely give you clues as to what app is involved.

如果不是,请右键单击该进程,然后选择“打开文件位置”。 该文件的位置可能会为您提供有关所涉应用程序的线索。

When Once you’re there, you can use the End Process, Open File Location, or Go to Service(s) options to control the process or stop it.

到位后,您可以使用“结束进程”,“打开文件位置”或“转到服务”选项来控制或停止该进程。

使用NirSoft CurrPorts查看正在侦听的端口 (Use NirSoft CurrPorts to View What is Listening on a Port)

If you aren’t really the Command Prompt type—or you’d rather just use a simple utility to do all this in one step—we recommend the excellent freeware CurrPorts utility by NirSoft. Go ahead and download the tool. Just make sure you get the right version (the regular version is for 32-bit Windows and the x64 version is for 64-bit Windows). It’s a portable app, so you won’t need to install it. Just unzip the download folder and run executable.

如果您不是真正的命令提示符类型,或者您只想使用一个简单的实用工具就可以一步一步完成所有这些操作,则建议使用NirSoft提供的出色的免费软件CurrPorts实用工具。 继续下载该工具。 只要确保您获得正确的版本即可(常规版本适用于32位Windows,而x64版本适用于64位Windows)。 这是一款便携式应用程序,因此您无需安装它。 只需解压缩下载文件夹并运行可执行文件即可。

In the CurrPorts window, sort by the “Local Port” column, find the port you’re investigating, and you can see everything—the process name, PID, port, the full path to the process, and so on.

在CurrPorts窗口中,按“本地端口”列排序,找到您要调查的端口,然后您将看到所有内容-进程名称,PID,端口,进程的完整路径,等等。

To make it even easier, double-click on any process to see every single detail in one window.

为了使操作更加简单,双击任何过程都可以在一个窗口中查看每个细节。



When you’ve determined what app or service has the port you’re investigating tied up, it’s up to you how to handle it. If it’s an app, you may have the option to specify a different port number. If it’s a service—or you don’t have the option to specify a different port number—you’ll likely have to stop the service or remove the app.

确定要调查的端口与哪些应用程序或服务绑定在一起后,就由您决定如何处理它。 如果是应用程序,则可以选择指定其他端口号。 如果是一项服务,或者您没有选择指定其他端口号的选择,则可能必须停止该服务或删除该应用程序。

翻译自: https://www.howtogeek.com/howto/28609/how-can-i-tell-what-is-listening-on-a-tcpip-port-in-windows/

tcp/ip协议中的端口

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值