nmap

Linux · Network · reference only

What it does

Network and port scanner: it discovers live hosts, open ports and the services they offer.

Syntax

nmap [opciones] objetivo

Options and parameters

  • -p puertos

    Scans only those ports, such as 22,80 or 1-1024.

  • -sV

    Tries to find out the service and version of each open port.

  • -sS

    SYN scan, fast and stealthy (requires root).

  • -sn

    Only discovers live hosts, without scanning ports.

  • -Pn

    Does not check whether the host is up and scans directly.

  • -O

    Tries to detect the operating system (requires root).

  • -T4

    Aggressive timing template, suitable for local networks.

  • --open

    Shows only open ports.

Usage examples

  • nmap localhost

    Scans the most common ports of your own machine.

  • nmap -p 22,80,443 192.168.1.10

    Checks only those three ports on a host.

  • nmap -sV scanme.nmap.org

    Detects service versions on the test server that the Nmap project provides for practice.

  • nmap -sn 192.168.1.0/24

    Discovers which hosts are up on your local network.

Notes and common mistakes

  • Scanning other people's machines without permission may be illegal: use only your own machines or authorized practice environments.
  • It is installed with sudo apt install nmap.

Related commands