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

Prepare for the Nmap and ZenMap Tests. Access flashcards and multiple choice questions, with hints and explanations for each question. Ensure success in 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 Passetra

You can unsubscribe at any time. Read our privacy policy