Commandos

The commands they work perfectly to confirm if a port is open or not.

commands

What are the commands that work to check if a port is open or not?

The first thing you should know before knowing the commands chords, is the meaning of port, and it is that at any time in your life you have surely heard this term, but you do not have a clear definition.

The ports are the means by which all data can be transmitted from one place to anotherFor example, between computers, or even with the Internet.

In addition, the port numbers are also part of the IP address, because they are in charge of assigning the different data packets to it, and also to the specific servers, to give rise to the full destination address.

Having several network ports is very necessary, this is because there are many processes that are carried out simultaneously in the operating systems, and therefore require data to be transmitted at the same time.

To identify each port, numbers ranging from 0 to 65.535 are used, that is, each computer has 65.536 ports in total.

It is important to know if the ports are open or not, because there are many that are used only for applications, servers or even web pages.

Three commands that help you tell if a port is open

Now entering the main topic we will leave you the three commands that will help you scan your ports and determine if they are open or not.

Nmap

It is one of the most used, and it is that, in addition to being free, it is also aimed especially at experts on the subject.

But not only this, it is also a scanner created specifically for the Linux operating system, however, currently it can be used on any device.

The best thing is that it has two ways to use it, if you are an expert you can do it with the command line, but if you are a beginner, it is advisable to use the Zeenmap GUI.

It is a scanner that should be used only with its own local ports, and not with those belonging to other addresses. To perform the scan you must do the following:

  • Once installed, you must place #apt-get install nmap.
  • In order for the open ports of your computer to appear, you must write #nmap localhsot. Please note that these do not necessarily link to the Internet.
  • On the other hand, if you want to see the ports that are open and related to the Internet, you must do the same, but also, you must add the IP address.

NC

NC is also known as netcat, it is one of the best tools that the line of commands to search for data on the network. It is also an excellent option because it is very easy to use, and it helps you to know if a port is open.

  • Start by pressing the keys Windows + R.
  • In the box that appears on your screen you must write »cmd».
  • Then click the button "To accept".
  • The following appears on your computer screen:
  • Now, for the program (nc.exe) to start, you need to modify the storage location.
  • It is recommended that the file »nc.exe» be saved in the folder named netcat, and should appear as follows: cd C:/Users/USERNAME/Desktop/netcat/
  • To carry out the port scan, it is important to take into account the IP address.
  • You must place nc-zv {IP-OR-DOMAIN} {PORT}. For example, nc-zv 192.168.122.88 80.
  • The letter v is the one that indicates when a port is open or not.
  • The z is in charge of closing the connection, once the status of the port is checked.

telnet

Telnet is another of the options you have to find out if a port is open or closed. It works like a protocol that enters directly to the communication line. server commands.

  • The first thing you should do is open a terminal. You do this by entering the start menu, and select the option "system".
  • Then you must click "console".
  • The console opens, and that's the time to start executing »telnet+server or IP number+port number».
  • Finally, press the key »Enter», and immediately the results you want appear on your screen.

Port testing with online pages

Not only are the commands available for checking the ports, there is also a way to do it through Web pages, however, these are not highly recommended, but we mention them anyway:

  • DNSTOOLS: It is in charge of scanning different standard ports, examples of these are FTP, DNS, IMAP, among others. It is in charge of verifying the individual ones, and also makes sure to check if the operation of the public ports is adequate.
  • TCP Open Port Scanner: It is a page that quickly scans all the ports that are open to the outside.