CompTIA PenTest+ (PT0-002) — Question 29

A penetration tester ran the following command on a staging server: python -m SimpleHTTPServer 9891
Which of the following commands could be used to download a file named exploit to a target machine for execution?

Answer options

Correct answer: D

Explanation

The correct command is D, as wget is specifically designed to download files from web servers. Option A uses netcat inappropriately for downloading, while B incorrectly formats the PowerShell command and attempts to access a file share instead of a web server. Option C is using bash to connect to a TCP port, which does not facilitate file downloading in this context.