Warm tip: This article is reproduced from serverfault.com, please click

What does the -P0 option do when using nmap?

发布于 2021-01-20 10:43:54

I'm trying to understand the basics of nmap and its functionality. I am using wireshark to check the network flow. I have a question regarding the following option.

What is the difference between the following commands. Is it recommended to use the -P0 option or not?

nmap -p113 scanme.nmap.org

nmap -p113 -P0 scanme.nmap.org

I have been trying to find what the -P0 option does but i can't find it in any nmap options cheat sheet.

Questioner
Mavil
Viewed
0
Joel Bodenmann 2021-01-20 23:36:20

From the nmap manual we learn:

In previous versions of Nmap, -Pn was -P0. and -PN..

Therefore, -P0 is now -Pn.

Now what is -Pn?

This option skips the Nmap discovery stage altogether. Normally, Nmap uses this stage to determine active machines for heavier scanning. By default, Nmap only performs heavy probing such as port scans, version detection, or OS detection against hosts that are found to be up. Disabling host discovery with -Pn causes Nmap to attempt the requested scanning functions against every target IP address specified. [...]