GPEN · Question #115
Which of the following commands can be used for port scanning?
The correct answer is A. nc -z. Netcat's -z flag enables zero-I/O mode, which sends no data and is used specifically for port scanning to check which ports are open.
Question
Which of the following commands can be used for port scanning?
Options
- Anc -z
- Bnc -t
- Cnc -w
- Dnc 璯
How the community answered
(46 responses)- A78% (36)
- B7% (3)
- C13% (6)
- D2% (1)
Why each option
Netcat's -z flag enables zero-I/O mode, which sends no data and is used specifically for port scanning to check which ports are open.
The nc -z flag activates zero-I/O mode in Netcat, where it connects to a port to determine if it is open without sending or receiving any data. This makes it functionally equivalent to a basic port scan, allowing a user to quickly sweep a range of ports - for example, nc -z host 20-80 - to identify listening services.
nc -t enables TELNET protocol negotiation in the connection, which is unrelated to port scanning.
nc -w sets a timeout in seconds for idle connections, controlling how long Netcat waits before giving up, not performing a port scan.
The character shown is a corrupted or invalid argument and does not correspond to any recognized Netcat flag.
Concept tested: Netcat zero-I/O mode for port scanning
Source: https://man7.org/linux/man-pages/man1/ncat.1.html
Topics
Community Discussion
No community discussion yet for this question.