Use XP's New Netstat and Tasklist To Find Out Who's Talking To Your Computer
Here's a neat feature that I really like about XP: Netstat's new -o option.
If you don't know Netstat, then you should. It reports to you all of the network connections that your system has open at the moment. I used to use it with the -a option. -a says to show all network connections. The new -o option says to identify the process ID ("PID") of the program that started that connection. For example, under Windows 2000 I might have typed netstat -a and gotten a line like this in the output:
TCP GX240:1844 64.4.13.224:1863 ESTABLISHED
Unraveled, this line says that my workstation (GX240) is connected via port 1844 to some system at 64.4.13.224. Hmmm, I'd say, what's going on here? I don't remember agreeing to open up a link to someone out on the Internet. Is this some evil worm? Sure wish I could figure out WHICH program told my workstation to open this link. Well, of course, as my workstation is running XP, I can with the -ao switch. The output (excerpted) now looks like
Proto Local Address Foreign Address State PID ...
TCP GX240:1844 64.4.13.224:1863 ESTABLISHED 2132
Ah, there's the culprit -- whatever's running on process ID 2132. But how do I find out what that is? With another XP command-line command, tasklist. I could just run tasklist and pick out the program with PID 2132, but here's a way to get a somewhat cleaner output, using tasklist's "/fi" (filter) command. I'd type
tasklist /fi "pid eq 2132"That would yield this output:
Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
msmsgs.exe 2132 Console 0 3,848 KAha! "msmsgs" is Windows Messenger. It keeps a line open to a Microsoft server so that if someone wants to establish a Messenger session with me then my system will know to respond.