How to run an Open Port Check through CMD?
Port checks are very commonly done by network administrators and are routine practice. Why is it so important? Before we look into the various means of running a port check and what this helps to achieve, let’s have a look at what these ports mean in networking communications.
How do ports work?
Ports in networking, mainly help execute endpoint communications that belong to the TCP/IP Protocol Stack or the UDP. Transmission Control Protocol or TCP a connection-based protocol that requires a circuit between two or more networks within which data can transfer between the source and the destination. The information at these entry/exit points is sent and received through TCP ports (if the TCP/IP Protocol employees).
Think of opening a web browser. When you type in “cloudsurph.com“, your browser translates that to “http://www.cloudsurph.com”. And with that, you’re specifying the hypertext transfer protocol — and hopefully, you get the page without issue. That happens because Cloudsurph.com’s web server aka its HTTP server is listening for incoming connections on a particular port address.
One of the best-known ports for HTTP is 80. By contrast, you might download some software from ftp.microsoft.com, their FTP server is going to be listening on the well-known Port 23. And so forth.
What makes ports so important?
Ports are the starting and ending points on the networks where the information requests and from where it delivers. So, the port of destination also helps identify the port of origin as a secure source, while the port from where the data transmitted identifies and sets the path on the network for the data to be securely deliveres.
Many enterprise apps and software such as Oracle and SQL require users to set up services on discrete port numbers. This means network administrators, within infrastructures that use such software, have to ensure that these ports remain open to allow for traffic to flow through them.
Most trojans and viruses make their way to a host computer through an unchecked port that has been left open. This requires active monitoring through a firewall, to restrict access to only authorized channels.
How to check for open ports?
Administrators may use one of various means to look for open ports and the tasks running through these ports.
Various open-source utility tools and websites, such as canyouseeme.org help fulfill this purpose.
To check for an open port on can youseeme.org, type in the IP address in the relevant field and the port which you want to check. If you want to verify port accessibility on a remote computer, type the external IP address and the port number.
A search result that returns an error, means that port 80 closes on the computer with the IP address listed above. A successful search result means the port is open.
Before we go to checking open ports through CMD, let’s take a look at another online option for verifying port status.
Use NirSoft CurrPorts to check what is listening on a Port
If you do not prefer launching the command prompt until absolutely necessary and want to use another simple utility to perform this check, then you must try the CurrPorts utility by NirSoft. This utility can download.
Once the right version download, open the zip folder and run the executable file. In the CurrPorts window, sort by the “Local Port” column, find the port you’re investigating, and you can see everything—the process name, PID, port, the full path to the process, and so on.
You may double-click on an individual process to expand the details related to each port connection.
Checking open ports through CMD
The most commonly used way to look for open ports in the command line is through Netstat.
To do this, simply run the command prompt as administrator and run the Netstat command.
There are two options to go about doing this. Both differ in how the details are shown. The first option will list all active ports and the name of the process that uses them. It’s “netstat -ab.” The second option, “netstat -aon” will also provide a process ID you can later check-up in the Task Manager.
Below is a list of what each letter in the Netstat command represents
- “a” will display all connections and listening ports.
- “b” will display all executables that involve in creating each listening port.
- “o” will show the owning process ID that relates to each of the connections.
- “n” will show the addresses and port numbers as numerals.
Now let’s look at these commands in more detail.
Run the Netstat -ab command in the command line
The name of the port should appear to the left of the local IP address.
If the state column next to a port number says “Listening”, this means that a particular port is open.
Type 2 –
The second option of the Netstat command comes in handy when more information than simply the program tied with a port, requires.
To use the second netstat command, access the command prompt just as in option 1. Type the Netstat -aon command and hit enter.
This time, five columns will appear. Namely, Protocols, Local Address, Foreign Address, State, and Process ID.
You can use the Process ID in the far right column to trace the program in the task manager, with which it is associated with. The name of the program will be mentioned in the description column on the Taskbar.