How can you specify both TCP and UDP ports in a single -p specification, and what would an example look like?

Study for the Nmap/ZenMap Switches Test. Prepare with flashcards and multiple choice questions, each question provides hints and explanations. Get ready for your exam!

Multiple Choice

How can you specify both TCP and UDP ports in a single -p specification, and what would an example look like?

Explanation:
You specify per-protocol ports by prefixing the port lists with the protocol and separating them with commas. TCP ports use T: and UDP ports use U:. Since the default is TCP, simply listing numbers would apply to TCP only, so to include UDP you must indicate the protocol for those ports. An example that combines both in one -p is: -p T:80,443,U:53. This means scan TCP ports 80 and 443 and UDP port 53 in a single command. You can also mix ranges, like -p T:1-1024,U:53,67, to include larger TCP ranges and additional UDP ports.

You specify per-protocol ports by prefixing the port lists with the protocol and separating them with commas. TCP ports use T: and UDP ports use U:. Since the default is TCP, simply listing numbers would apply to TCP only, so to include UDP you must indicate the protocol for those ports. An example that combines both in one -p is: -p T:80,443,U:53. This means scan TCP ports 80 and 443 and UDP port 53 in a single command. You can also mix ranges, like -p T:1-1024,U:53,67, to include larger TCP ranges and additional UDP ports.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy