GPEN practice question 27 of 35

A penetration tester used a client-side browser exploit from metasploit to get an unprivileged shell prompt on the target Windows desktop. The penetration tester then tried using the getsystem command to perform a local privilege escalation which failed. Which of the following could resolve the problem?

Full set: 385 questions
Answer options
A: Load priv module and try getsystem again
B: Run getuid command, then getpriv command, and try getsystem again Correct answer
C: Run getuid command and try getsystem again
D: Use getprivs command instead of getsystem
Correct Answer:
B. Run getuid command, then getpriv command, and try getsystem again
Explanation

The getsystem command in Metasploit's Meterpreter attempts several techniques to escalate privileges to the NT AUTHORITY\SYSTEM account. Its success is contingent upon the specific privileges held by the process token of the compromised user. When getsystem fails, it is typically because the current user context lacks the necessary privileges (e.g., SeImpersonatePrivilege, SeDebugPrivilege) for any of its built-in techniques to succeed. The standard and logical procedure for a penetration tester in this scenario is to perform situational awareness to diagnose the failure. This involves running getuid to confirm the current user context and, crucially, running getprivs to enumerate all privileges available to the current process. This diagnosis is the first step toward resolving the problem, as it informs the tester which alternative local privilege escalation exploits might be successful.

Why Incorrect

A. The priv extension, which contains commands like getsystem and getprivs, is loaded by default with the Meterpreter stdapi. Reloading it would not grant new privileges or resolve the underlying reason for the failure.
C. Running getuid only confirms the current user's identity. It is an informational command that does not alter the system state or privileges, and therefore would not cause a subsequent getsystem attempt to succeed.
D. The getprivs command is used to list current privileges, while getsystem is used to escalate them. They serve fundamentally different purposes; one cannot be used as a substitute for the other to achieve privilege escalation.

References

1. Metasploit Unleashed (MSFU) by Offensive Security: This is a free

university-level courseware resource for learning the Metasploit Framework. The "Privilege Escalation" section details the use of Meterpreter commands. It implicitly supports the methodology of checking user context and privileges as a standard step. The documentation for Meterpreter commands shows getuid for identifying the user and getprivs for enumerating process privileges

which are prerequisites for understanding why an escalation command like getsystem might fail.

Reference: Offensive Security

"Metasploit Unleashed

" Section: "Meterpreter Basic Commands" and "Privilege Escalation." (e.g.

getuid

getprivs usage).

2. Rapid7 - Official Metasploit Documentation: The official documentation describes the function of these specific Meterpreter commands.

Reference: "Working with a session" documentation for Metasploit Pro. It lists getsystem as an escalation attempt and notes its dependency on system configuration. It also lists getuid and getprivs as commands for gathering information about the compromised system

which is the necessary step when an automated attempt like getsystem fails.

3. Carnegie Mellon University

Software Engineering Institute (SEI) - "Common Sense Guide to Mitigating Insider Threats": While not a direct Metasploit guide

this type of academic and research publication discusses the principle of least privilege. The failure of getsystem is a direct consequence of this principle being enforced to some degree on the target. The resolution process described in option B aligns with the analytical approach required to bypass such security controls.

Reference: Cappelli

D. M.

Moore

A. P.

& Trzeciak

R. F. (2012). "The CERT Common Sense Guide to Mitigating Insider Threats

4th Edition." SEI

Carnegie Mellon University. (Specifically

concepts in Chapter 4 on understanding system privileges).

Scroll to Top