Home > Back-end >  How can you get a list of IPs accessed by a defined Process?
How can you get a list of IPs accessed by a defined Process?

Time:10-12

The goal of this is to redirect the traffic from a specific application (The process name matching a specific Text) to a separate gateway address without interfering with other traffic going through my main gateway, since there are network shares and other servers connected that cannot lose the connection. I have already been able to redirect specific IPs that I found in the Resource Manager, but they constantly change and sometimes parts of Programs access different servers which I cannot see until they are used, obviously.

The desired end result would be a list of IP addresses that the given Process is using. On this list I want to run a loop which basically routs the IP addresses to the other gateway: route add IP mask 255.255.255.255 otherGateway

CodePudding user response:

SysInternals TCPVcon (TCPView for console) can do that. It has a command line option to output the result as CSV.

tcpvcon [-a] [-c] [-n] [process name or PID]

CodePudding user response:

Use proxy setting in app. If there is nonthing about proxy, try using ProxyCap or similar software.

Alternatively you can use ProcMon and TCPView to get all connections made by process. But beware of

  • network calls can be made by child processes (ex., app.exe starts powershell that makes request)
  • IP addresses can change due to many reasons.
  • Related