GIAC
GCIH · Question #790
GCIH Question #790: Real Exam Question with Answer & Explanation
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
Explanation
The netcat command with -z flag performs a port scan in zero-I/O mode across the specified port range on the target host.
Common mistakes.
- A. Creating a listener requires the -l flag; the -z flag does the opposite by initiating outbound connection attempts to probe remote ports.
- C. Sending files with netcat requires piping or redirecting file content into the command and does not use the -z flag or a port range.
- D. 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
Reference. https://linux.die.net/man/1/nc
Community Discussion
No community discussion yet for this question.