GCIH · Question #790
What does the following command do? nc -v -z 192.168.40.90 1-1024
The correct answer is B. Port scan on all well-known ports for host 192.168.40.90. The netcat command with -z flag performs a port scan in zero-I/O mode across the specified port range on the target host.
Question
What does the following command do? nc -v -z 192.168.40.90 1-1024
Options
- ACreates a listener on all well-known ports on 192.168.40.90
- BPort scan on all well-known ports for host 192.168.40.90
- CSends files from to the host 192.168.40.90
- DConduct a vulnerability scan on all well-known ports
How the community answered
(28 responses)- A4% (1)
- B89% (25)
- C7% (2)
Why each option
The netcat command with -z flag performs a port scan in zero-I/O mode across the specified port range on the target host.
Creating a listener requires the -l flag; the -z flag does the opposite by initiating outbound connection attempts to probe remote ports.
The -z flag in netcat enables zero-I/O mode, meaning netcat probes ports without sending any data payload. Combined with the port range 1-1024 and target IP 192.168.40.90, this command checks all well-known ports to determine which are open or listening. The -v flag adds verbose output to display the result of each port probe.
Sending files with netcat requires piping or redirecting file content into the command and does not use the -z flag or a port range.
Netcat only checks basic TCP/UDP port connectivity and lacks the vulnerability detection engine found in dedicated scanners like Nessus or OpenVAS.
Concept tested: Netcat port scanning with -z flag
Source: https://linux.die.net/man/1/nc
Topics
Community Discussion
No community discussion yet for this question.