Post-exploitation and Lateral Movement
Which cmd.exe switch runs a given command string and then terminates the command interpreter?
Show the answer
Correct answerA. /c
AWhy this is right: It runs the command string and then exits, giving one-shot execution.
BWhy not this: It makes command output Unicode; it has no effect on termination.
CWhy not this: It runs the command but keeps the interpreter open afterward, so it does not terminate.
DWhy not this: It turns command echo off; it does not control whether cmd.exe exits.
The /c switch carries out the specified command and then ends cmd.exe, which suits one-shot execution from other tools. The /k switch also runs the command but leaves the interpreter open.