If I type "netstat", I can see a list of IP addresses that my PC is connected to.
If I start with an IP address, how do I find the process that has opened the connection to said IP address?
If I type "netstat", I can see a list of IP addresses that my PC is connected to.
If I start with an IP address, how do I find the process that has opened the connection to said IP address?
I find following command quite convenient
1- open cmd > netstat -ano
2- you will see a column says PID with a number
3- open task manager, go to processes tab, and select "view" menu while you are on this tab
4- then choose "select column" and add PID
Now you will see what the PID from the netstat command is bind to
You're going to want to use either
lsof
orfuser
.lsof
has an easier syntax, plus it directly shows all relevant info including the process executable name:You can use
sockstat -c | grep IP.IP.IP.IP
.Without grep the output looks like this.
With grep you simple filter so it only shows the desired IP, but the header is also lost.