Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What does -p- tag mean in Nmap

I am learning about Cybersecurity using TryHackMe and I have a couple of questions regarding Nmap:

  1. What does -p- mean in Nmap? For example when doing this: nmap -p- 10.10.57.197 --open

  2. What is the purpose of using it together with --open?

    MEDevel.com: Open-source for Healthcare and Education

    Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

    Visit Medevel

I just get different result when using and not using -p- and --open and I couldn’t find anything on the internet (if you can share some nice docs I would be really grateful!).

Thanks!

>Solution :

-p is the option to define the port range to scan. the extra - is a shorthand way to describe the range 1-65535.

I.E. -p- is equivalent to -p 1-65535 which is just scan all ports.

The --open option is a filter. It filters out ports that are in any state that is not Open like closed or filtered ports.
https://nmap.org/book/man-port-scanning-basics.html

There’s a good example about the --open option here:
https://security.stackexchange.com/questions/227492/how-to-only-display-open-ports

Given this, nmap -p- 10.10.57.197 --open is saying scan ports 1-65535 and only show me ports that are open.

Please note that you can typically find what these options do by visiting the man pages for nmap or the official docs:
https://nmap.org/book/port-scanning-options.html

You can access the man page for nmap with this command:

man nmap

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading