During a penetration test, you have compromised a Linux host and want to leave a simple TCP backdoor. Using a netcat implementation that still supports command execution, which one-line command will make the host listen on TCP port 4444 and attach any incoming connection to an interactive Bourne shell for follow-on access?
Use a command with -u to open a port on 4444 and rely on a datagram-based mechanism for the shell
Set a command with -p 4444 to listen for inbound connections without specifying any interactive process
Specify a process with -e /bin/sh that connects to 127.0.0.1 to attach an interactive shell locally
Run a command with -l -p 4444 -v -e /bin/sh to create a listening socket and spawn an interactive shell
The listener must include the option to listen (-l), specify a port (-p 4444), and execute a process (-e /bin/sh). Combining these switches builds a bind shell that waits for a connection and hands it an interactive shell. Commands that omit -l, omit -e, or switch to UDP will not provide the required interactive backdoor.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the '-e /bin/sh' flag do in the command?
Open an interactive chat with Bash
Why is the '-p 4444' flag important for the listener setup?
Open an interactive chat with Bash
How does a socket differ from a datagram in the context of setting up a listener?