Tuesday, December 26, 2017

Find the used ports in machine

We need to find the all the used ports in a machine. We can get to know easily with the command

netstat -ano

this will give the output as

Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:85             0.0.0.0:0              LISTENING       5180
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       892


IF you need to verify the PID with the processes, open Task Manager. This will show 'PID'

netstat -ano > log.txt