What does the nmap -p- command do?

Viewed 50

I just started using hack the box and I find it confusing which nmap commands are being used and why. Most of the time they use nmap -sV {Target IP} but other times they use nmap -p- -sv {Target IP}.

I tried looking through the command lists but I don't see any -p- attribute, what exactly is this scan doing?

1 Answers

-p- is for scanning all the 65535 ports.

From man nmap:

-p port ranges (Only scan specified ports)
           ...
           So you can specify -p- to scan ports from 1 through 65535.
           ...
Related