PT0-001 · Question #155
A penetration tester has compromised a host. Which of the following would be the correct syntax to create a Netcat listener on the device?
The correct answer is A. nc -lvp 4444 /bin/bash. Creating a Netcat listener requires the -l (listen), -v (verbose), and -p (port) flags combined in a single command to correctly bind and await incoming connections on a specified port.
Question
A penetration tester has compromised a host. Which of the following would be the correct syntax to create a Netcat listener on the device?
Options
- Anc -lvp 4444 /bin/bash
- Bnc -vp 4444 /bin/bash
- Cnc -p 4444 /bin/bash
- Dnc -lp 4444 -e /bin/bash
How the community answered
(38 responses)- A87% (33)
- B3% (1)
- C3% (1)
- D8% (3)
Why each option
Creating a Netcat listener requires the -l (listen), -v (verbose), and -p (port) flags combined in a single command to correctly bind and await incoming connections on a specified port.
The command nc -lvp 4444 /bin/bash uses -l to enable listen mode, -v for verbose output, and -p to specify port 4444, which are the three essential flags for establishing a Netcat listener. Together these flags configure Netcat to passively wait for an inbound connection on the designated port rather than initiating an outbound connection.
Option B omits the -l flag, which is required to enable listen mode; without it, Netcat attempts to initiate an outbound connection instead of waiting for an inbound one.
Option C omits both the -l flag for listen mode and the -v flag for verbose output, making it unable to function as a listener and providing no connection status feedback.
Option D omits the -v (verbose) flag; while -e /bin/bash correctly binds a shell to the connection in some Netcat variants, the missing verbosity flag means the tester loses connection status information, making this an incomplete standard listener syntax.
Concept tested: Netcat listener command syntax and required flags
Source: https://nmap.org/ncat/guide/ncat-usage.html
Topics
Community Discussion
No community discussion yet for this question.