The Netstat Tool
The Netstat tool displays a variety of information about active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, and IPv4 and IPv6 statistics. In Windows XP with SP2, the Netstat tool supports a new –b option that displays the set of components by file name that are listening on each open TCP and UDP port.
In Windows XP with SP1 and Windows XP with SP2, you can use the netstat –ano command to display the complete set of ports being listened to in numerical form and their corresponding process IDs (PIDs). You can then look up the PID in the display of the tasklist /svc command to discover the name of the process that owns the port. However, in some cases, there are multiple services within a single process and it is not possible with the netstat –ano command to determine which service within the process owns the port.
With the netstat –anb command, Netstat displays the complete set of TCP or UDP ports in numerical form, the file names corresponding to the components of the service that owns the port, and the corresponding PIDs. From the file names and the PID, you can determine which of the services in the display of the tasklist /svc command opened the port.
|