icon

May 21, 2010

Which Application is Listening or Opening Port

Open Command Prompt window by typing Cmd in Run command box or Start Search, and hit Enter.
Type in the following netstat command:
netstat -o -n -a | findstr 0.0:80

or

netstat -o -n -a | findstr 0.0:443

or simply,

netstat -aon

Note: The last command will list all connection that is listening, established, starting, closing and all other states, so the list is long, and user has to manually search for rows that has connection originating or targeting to 1270.0.1:80/443 or 0.0.0.0.80/443.

The following line(s) of results should be returned:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 8704

The last column of each row is the process identified (process ID or PID).

Identify which process or application is using the port by matching the PID against PID number in Task Manager.
Another alternative to determine and identify which application is using port 80 or 443 is by using Telnet application. Just type the following command to Telnet to the system in port 80 or 443:

telnet localhost 80

or,

telnet localhost 443

If the Telnet connection can be opened, normally the banner of the application which opens the port will be shown, and help user to identify which process that actually listening on the port.

Tip: The command above can be used to identify and check what processes is using any other ports too, such as 7 (Echo), 21 (FTP), 23 (Telnet), 25 (SMTP), 53 (DNS), 70 (Gopher), 79 (Finger), 107 (RTelnet), 110 (POP3), 119 (NNTP), 139 (NetBIOS), 143 (IMAP), 194 (IRC), 3128, 8080, 10000, and etc.

No comments: