CompTIA PenTest+ (PT0-001) — Question 10
A penetration tester has compromised a Windows server and is attempting to achieve persistence. Which of the following would achieve that goal?
Answer options
- A. schtasks.exe /create/tr ג€powershell.exeג€ Sv.ps1 /run
- B. net session server | dsquery -user | net use c$
- C. powershell && set-executionpolicy unrestricted
- D. reg save HKLM\System\CurrentControlSet\Services\Sv.reg
Correct answer: D
Explanation
The correct answer, D, saves the registry settings of a service, which can be modified later to ensure persistence. Option A attempts to create a scheduled task but contains syntax issues that make it ineffective. Option B is unrelated to achieving persistence, focusing instead on session and user queries. Option C changes the execution policy but does not guarantee persistence on the system.