How do I list applications using network ports?


This article applies to:

  • All Marshal Product Line products

Question:

  • How do I determine what port an application is using?
  • How do I determine what application is using a specific port?

Procedure:

Follow the steps below to determine if a network port is being used on a server, and the specific application using the port:

  1. Open a command window
  2. Type netstat -nabo
    • The output displays all listening applications and network connections established from the machine, the local and remote IP address and port in use, the process ID and the name of the executable that has established the connection.
    • Example output:

      Active Connections

        Proto  Local Address          Foreign Address        State           PID
        TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4

       Can not obtain ownership information
        TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       872
        RpcSs
       [svchost.exe]
        TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4

       Can not obtain ownership information
        TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       2308
       [WMProxy.exe]
        TCP    0.0.0.0:8081           0.0.0.0:0              LISTENING       2308
       [WMProxy.exe]
        TCP    0.0.0.0:19100          0.0.0.0:0              LISTENING       2792
       [WMArrayMGR.exe]
        TCP    0.0.0.0:19101          0.0.0.0:0              LISTENING       2792
       [WMArrayMGR.exe]
        TCP    0.0.0.0:19102          0.0.0.0:0              LISTENING       2984
       [WMController.exe]
        TCP    0.0.0.0:49152          0.0.0.0:0              LISTENING       544
       [wininit.exe]
        TCP    0.0.0.0:49153          0.0.0.0:0              LISTENING       996
        EventLog
       [svchost.exe]
        TCP    0.0.0.0:49154          0.0.0.0:0              LISTENING       244
        Schedule
       [svchost.exe]
        TCP    0.0.0.0:49155          0.0.0.0:0              LISTENING       636
       [lsass.exe]
        TCP    0.0.0.0:49160          0.0.0.0:0              LISTENING       624
       [services.exe]
        TCP    0.0.0.0:49165          0.0.0.0:0              LISTENING       1796
       [sqlservr.exe]
        TCP    0.0.0.0:49182          0.0.0.0:0              LISTENING       1744
       [sqlservr.exe]
        TCP    10.64.21.63:139        0.0.0.0:0              LISTENING       4

       Can not obtain ownership information
        TCP    10.64.21.63:49165      10.64.21.63:49167      ESTABLISHED     1796
       [sqlservr.exe]
        TCP    10.64.21.63:49167      10.64.21.63:49165      ESTABLISHED     2792
       [WMArrayMGR.exe]

Results displayed can vary depending on your permissions, and the results sometimes take a long time to generate.

In some cases you might find that the following steps allow you to get more information more quickly:

  1. Type netstat -nao
  2. In the output column "Local Address", locate the port number of interest. Note the PID (Process ID) that corresponds to the port.
  3. Use Task Manager or the command line Tasklist command to find the name of the executable.
    • For instance:
      C:\> tasklist | findstr 2308
      WMProxy.exe                 2308 Console                 0     17,104 K

Notes:

  • You can use this method to determine if another proxy or SMTP listener is binding to ports required by MailMarshal SMTP or WebMarshal. You can also check for issues with the ports used by the Array Managers and user interfaces.
  • You can limit the output of NETSTAT with additional parameters. To list parameters type netstat -?

    Last Modified 3/1/2020.
    https://support.trustwave.com/kb/KnowledgebaseArticle12702.aspx