Thursday, January 8, 2015

WHICH PROCESS ID LISTENING ON WHICH PORT? ???

Good day All,

Welcome back and a very Happy New Year.. this is my first post this year and hopefully will share lot more than last year.

The other day some one asked me i have a process running and need to find out which port is it listening? Well that was easy i know sometimes little things are hard to remember, so i said you can get it from netstat..
I don't want to go over different options available in netstat, let you guys explore but for this to be achieved you should use something like this
netstat -nao
this will scroll through the list of all the tcp/udp ports listening and which Process id is being used.



You will realize that its the big list , so if you know which port number you trying to search then you do something like this
ex: netstat -nao | find "161"

What i am trying to do is find out which process ID\Process is listening on Port 161..If any one have a question how did you correlate PID and Process then open task manger add a column PID , there you know now.
So in the below example i clearly see that PID 1960 is used by SNMP on the default port 161.

.
Hope this helps someone!!!

No comments:

Post a Comment