How do I find out which program and process ID accesses a given IP address in Windows?

TCPView Solution

TCPView from SystemInternals will display "detailed listings of all TCP and UDP endpoints on your system, including the local and remote addresses and state of TCP connections."

TCPView is a Windows program that will show you detailed listings of all TCP and UDP endpoints on your system, including the local and remote addresses and state of TCP connections. On Windows Server 2008, Vista, and XP, TCPView also reports the name of the process that owns the endpoint. TCPView provides a more informative and conveniently presented subset of the Netstat program that ships with Windows. The TCPView download includes Tcpvcon, a command-line version with the same functionality.

enter image description here

  • Make sure you have "Resolve Addresses" unticked to get IP Addresses instead of Domain Names.

    enter image description here

You can sort the results by "Remote Address" to find the IP Address you are interested in.

Example:

  • This screenshot shows Firefox connecting to stackoverflow.com.

    enter image description here


CurrPorts Solution

CurrPorts from Nirsoft provides very similar functionality.

CurrPorts is network monitoring software that displays the list of all currently opened TCP/IP and UDP ports on your local computer. For each port in the list, information about the process that opened the port is also displayed, including the process name, full path of the process, version information of the process (product name, file description, and so on), the time that the process was created, and the user that created it.

enter image description here

Example:

  • This screenshot shows Firefox connecting to stackoverflow.com.

    enter image description here


What if I want to log the results?

TcpLogView also from Nirsoft provides logging of TCP connnections.

TcpLogView is a simple utility that monitors the opened TCP connections on your system, and adds a new log line every time that a TCP connection is opened or closed. For every log line, the following information is displayed: Even Time, Event Type (Open, Close, Listen), Local Address, Remote Address, Remote Host Name, Local Port, Remote Port, Process ID, Process Name, and the country information of the Remote IP (Requires to download IP to country file separately.)

enter image description here


Disclaimer

I am not affiliated with SystemInternals (part of Microsoft) or Nirsoft in any way, I am just an end user of their (free) utilities.


In Windows 7/8*/10 you can use Resource Monitor -> Network Tab.

Easiest way to open the resource monitor is:

  • Open Task Manager (right taskbar -> Start Task Manager)
  • Click Performance tab
  • Click Resource Monitor button

Resource Monitor -> Network

* = unconfirmed


You can achieve this without downloading additional tools from an admin command shell as well.

Run an admin command shell:

  • Press start button
  • Type "cmd"
  • Press Ctrl + Shift + Enter

Enter the command: netstat -tabn

The switches mean the following:

  • -t Displays the current connection offload state.
    • ie. ESTABLISHED, LISTENING, TIME_WAIT
  • -a Displays all connections and listening ports.
  • -b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executablen ame is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
  • -n Displays addresses and port numbers in numerical form.

This admittedly isn't nearly as sophisticated as the output achieved by the many GUI options but it is present and available without downloading additional tools. It works on Linux too with slightly different switches.