CompTIA PenTest+ (PT0-001) — Question 179

A penetration tester runs the following from a compromised `˜python -c `˜ import pty;pty.spawn (`/bin/bash`) '. Which of the following actions are the tester taking?

Answer options

Correct answer: B

Explanation

The correct answer is B because the command is used to spawn a new Bash shell, which upgrades the shell to a fully interactive one. Options A, C, and D are incorrect as they do not relate to the function of spawning a new shell; the command does not clear history, create a sandbox, or capture credentials.