Windows Privilege Escalation (Part 1 of 2)
Introduction
In addition to privileges, Windows also uses an integrity mechanism. It is an essential part of the Windows security architecture and offers application processes and secure objects different integrity levels. Hence, the level of confidence of operating system in running apps or secure objects can be described by this. Also, APIs might be restricted to a certain integrity level.
Windows Privileges
UAC has two distinct modes- credential prompt and consent prompt. If UAC is active and an ordinary user tries to carry out an administrative operation, like installing a new program, the user will encounter the credential prompt. So, to accomplish the work, an administrator user credentials are required. However, in case of an administrator user who tries to accomplish the same thing, a simple permission question is sent. In this case, the user only has to acknowledge that the job should be finished, user credentials are not required again.
Registry
A penetration tester can perform the following operations via Registry Editor:
- Find a value, key, subkey, or subtree.
- Add a value or a subkey.
- Change a value.
- Remove or rename a value or a subkey.
Registry hive is a logical collection of registry keys, subkeys, and values loaded into the memory when an operating system is launched or a user signs in. Registry entries used to execute malicious payloads might prove helpful to the penetration testers. They may switch the service's starting executable from the one that was initially specified to the one that can be controlled by exploiting vulnerabilities in registry permissions. This will allow them to run unauthorized malware.
Registry's enumeration can be done by various tools and ways. One of them is Accesschk.exe. It is a command line tool used for inspecting actual permissions on files, registry, services, and other objects. Another way to enumerate is via PowerShell. It can be used to locate user rights and complete authority over the service registry entry in the Access Control List (ACL).
In the end, pen tester can look for permissions of users and groups regarding malicious payload creation. An authorized user has complete access to the service and may alter the image path for service, create an executable shell and install it on the victim's computer. Then, edit the service registry key to an executable.
Comments
Post a Comment