Dino Geek, try to help you

What is the -p- option in NMAP?


The “-p” option in NMAP, also known as Network Mapper, is one of many command-line flags or options that a user can use to customize their network scanning activities.

According to the official NMAP documentation, the “-p” option is used to designate the target port or range of ports that the user wants to scan. Nmap supports a large number of scanning techniques such as SYN scan, ACK scan, TCP Open, and others, each with a potentially different outcome depending on the target ports status. By default, NMAP scans the top 1000 most popular ports, according to the statistical data collected by the NMAP team. However, with the “-p” flag, users can specify their ports of choice (Source: Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning – by Gordon Lyon).

The structure for using this option is as follows: nmap -p [port range] [target]. For example, if one wanted to scan ports 80, 443, and 20-25 on a target with the IP address 192.168.1.1, the command would be: nmap -p 80,443,20-25 192.168.1.1.

In terms of port ranges, users can input as ‘nmap p 1-65535’ to scan all ports from 1 through 65535, ‘nmap -p ‘ to also scan all ports including 0, or ‘nmap -p U:53,111,137,T:21-25,80,139,8080’ to scan both UDP and TCP but only specified ports. Remember that unnecessary broad port scans can take a large amount of time, and might alert Intrusion Detection Systems (IDS) or otherwise disadvantage the scanner (Source: NMAP man page: https://nmap.org/book/man-port-specification.html).

In terms of applying a method, one could scan port 22, the default port for SSH (Secure Shell) which is widely used for secure network communication, by typing ‘nmap -p 22 [target]’. If the scan returns ’22/tcp open’, it means the target is listening for SSH connections. However, if it returns ’22/tcp closed’, you can assume that the target is not listening for SSH connections on port 22, and might be vulnerable to attack (Source: Tanase, M. (2004). Mastering Nmap. Linux Journal, (122), 4.).

It’s crucial to note that while NMAP is an incredibly powerful tool for network administrators and cybersecurity practitioners, it should only be used ethically and within the confines of applicable laws and policies. Using NMAP to scan networks without the appropriate permissions is a violation of the Computer Fraud and Abuse Act in the United States and similar laws in other countries.

In summary, the “-p” option in NMAP is a very helpful tool for designating specific target ports or ranges of ports to scan, which can give users more control over their network scanning activities.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use