DelphiFAQ Home Search:
General :: Windows :: Network
Network setup and administration. Both from Windows and Linux angles.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Determine which ports a specific process on Windows is using


I suspect that a newly installed application may be listening on some ports and act as a backdoor. How can I determine which ports a specific process on Windows is using?


Windows does have the means to show you this. The following steps assume that your application is running on your computer and that you have Windows XP. Older Windows versions do not have all those tools e.g. the commandline task list tool and NETSTAT has not all the same parameters, but the steps are basically the same e.g. for Windows 2000.

The example inspects Yahoo Messenger (YPager.exe).

  1. Find out the process ID (PID) associated with your running application. You can use the task manager for that or from the command line:
    [c:\] tasklist | findstr YPager*

    This will show you the PID in the second column. (Try tasklist /fi "IMAGENAME eq YPager.exe" as an alternative; it will include the column headers.

  2. Now use the PID (in our example, it was 7200) and the NETSTAT tool.
    [c:\] netstat -ano | findstr 7200
       TCP               LISTENING     7200
       TCP               LISTENING     7200
       TCP   ESTABLISHED   7200
       UDP         *:*                                  7200
  3. This means Yahoo Messenger is listening on ports 4161 and 5101 for all addresses of this machine. It has an established connection with To find out who is behind this, use NSLOOKUP:
    I guess that is ok. You could also have tried netstat -a which shows you all connections, and with the IP numbers already resolved to names. Don't try this on a PC where Peer-to-Peer software (P2P) like edonkey, Kazaa or WinMX is running. You'll have to wait *very* long if your P2P system works as designed. :-)

If you need to do this kind of analysis a lot, you may want to check out a handy tool like TCPView - Freeware from Systernals.

Generated 16:02:16 on Jan 23, 2017