You can check open ports on a system using various methods. One of the most common tools for this purpose is Nmap. Here’s how to use Nmap to check for open ports:
Install Nmap: If you haven't installed Nmap yet, you can do so using your package manager. For example, on Ubuntu, you can run:
sudo apt-get install nmapRun Nmap: Use the following command to scan for open ports on a target machine (replace
TARGET_IPwith the actual IP address):nmap TARGET_IPScan Specific Ports: If you want to scan specific ports, you can specify them using the
-poption:nmap -p 22,80,443 TARGET_IPService Version Detection: To get more information about the services running on open ports, use the
-sVoption:nmap -sV TARGET_IPFast Scan: For a quicker scan of the most common 100 ports, you can use the
-Foption:nmap -F TARGET_IPCheck Local Ports: To check open ports on your local machine, you can run:
nmap localhost
These commands will help you identify open ports and the services associated with them.
