We have moved to www.dataGenX.net, Keep Learning with us.

Friday, May 17, 2013

What Service is Running on which Port in Windows




Finding out what application is running on a specific port in Windows is easy by using two command line utilities. By using netstat with the proper switches you can list out all of the ports that are being used and then use Tasklist to list all of the applications that are running. The combination of the two utilities will allow you to figure out which application us using which port.

As an example you can use the below directions to figure out At which port Oracle is running....


List Running Applications: Now use Tasklist as shown below to list the running applications and their coresponding PID (Process ID). We will be locating whatever application is running using PID 3000.

Tasklist | grep service_name

Example Output:

C:\>tasklist | grep oracle
oracle.exe                   436 RDP-Tcp#3               0    193,104 K   ---> 436 is the process id of Oracle

List Ports: Now use the below netstat command to list all of the applications which is running as 436 procss id for instance.

netstat -ano | grep 436

Example Output:

C:\>netstat -ano | grep 436
TCP    0.0.0.0:1029           0.0.0.0:0              LISTENING       436
TCP    192.168.10.16:1028     192.168.10.16:1521     ESTABLISHED     436


As you can see the local computer is listening to port 1029 on every available IP. The last number indicates the PID (here 436) of the application running on port 1029.