Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ CVE-2020-16939: Windows Group Policy DACL Overwrite Privilege Escalation

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š CVE-2020-16939: Windows Group Policy DACL Overwrite Privilege Escalation


๐Ÿ’ก Newskategorie: Hacking
๐Ÿ”— Quelle: thezdi.com

In October, Microsoft released a patch to correct a vulnerability in the Windows Group Policy client. The bug could allow an attacker to execute code with escalated privileges. This vulnerability was reported to the ZDI program by security researcher Nabeel Ahmed. He has graciously provided this detailed write-up and Proof-of-Concept detailing ZDI-20-1254/CVE-2020-16939.


This vulnerability abuses a SetSecurityFile operation performed during Group Policy update that is done in the context of NT AUTHORITY\SYSTEM. This operation is performed on all files within a certain folder. An attacker could create a directory junction to another folder and thereby obtain full permissions on the contents of that folder.

This vulnerability is similar to CVE-2019-0841 and CVE-2020-1317 as the end result is the same, except this one is triggered by Group Policy updates.

Intro

Group Policy Caching has been in use since Windows 8.1. It keeps a copy of the group policies in a local cache for performance purposes. User GPO Settings are stored in %programdata%\Microsoft\GroupPolicy\Users, while Computer GPO Settings are stored in %windir%\System32\GroupPolicy\DataStore.

The Vulnerability

As mentioned before, when a group policy update occurs, the policies are cached locally. We are particularly interested in the User GPO Settings cache location, which is %programdata%\Microsoft\GroupPolicy\Users. This is interesting because %programdata% is writeable by default even by a low-privileged user.

We first look at what file operations look like when we launch the gpupdate command in Windows as a low-privileged user. We will use Process Monitor from Sysinternals to get visibility into the various file operations.

We will use the ProcMon filter and highlight settings shown in the following screenshots:

Figure 1 - Process Monitor Filter settings

Figure 1 - Process Monitor Filter settings

Figure 2 - Process Monitor Highlighting settings

Figure 2 - Process Monitor Highlighting settings

The output of the gpupdate /target:user /force command looks something as follows:

Figure 3 - Procmon output Group Policy Update user GPO

Figure 3 - Procmon output Group Policy Update user GPO

When we scroll down the list of operations and skip the parts that are related to process creation, we soon start seeing SetSecurityFile operations that are remarkably performed without impersonation (lacking highlighting). That could be significant if the written Discretionary Access Control List (DACL) is too permissive.

Figure 4 - "SetSecurityFile" operations identified

Figure 4 - "SetSecurityFile" operations identified

As we will see later, some of the DACLs written are permissive, granting full control to the attacker. However, we still donโ€™t have an exploitable condition because files in these locations are not useful for conducting a privilege escalation. To try to redirect these DACL writes so that they apply to files that are useful to us, we can try to place a directory junction within the folder hierarchy. This may cause the Group Policy Update process to open our chosen target folder instead and write a DACL there.

Looking at the permissions on the folders, we notice the first obstacle: if a group policy update has already occurred, youโ€™ll notice that under the %programdata%\Microsoft\GroupPolicy\Users directory, an additional directory is created for each domain user based on his SID. The permissions on this folder do not allow us to write. The owner of the folder is the Administrators group and the Users group has only read and execute permissions, as inherited from the %programdata%\Microsoft folder.

Figure 5

Figure 5

However, if we move down the folder structure and analyze each folder then you will notice one small difference. The sysvol folder under the %programdata%\Microsoft\GroupPolicy\Users\<SID>\Datastore\0\ folder has the low-privileged user as the owner of the folder (seen in the screenshot below):

Figure 6

Figure 6

Since the low-privileged user is the owner of the sysvol folder, they can alter permissions on that folder without much issue. To do this, the low-privileged user should disable inheritance, and afterwards grant themselves "Full Control".

Once done, the low-privileged user is able to write files under the sysvol directory, and every folder and file under this folder is subjected to a DACL write operation in the context of NT AUTHORITY\SYSTEM when a Group Policy update is run.

Now this is starting to become more interesting. By creating a new folder within sysvol that is a junction to a chosen location, we can control which files and folders the Group Policy Service will open. In the following experiment, we told it to go to C:\Program Files (x86)\Microsoft, and it obediently followed the Directory Junction put in place by a low privileged user.

Figure 7 - Directory Junctions (Reparse Points) are followed by Group Policy Service

Figure 7 - Directory Junctions (Reparse Points) are followed by Group Policy Service

However, controlling the flow by putting a directory junction doesnโ€™t necessarily mean a low-privileged user can abuse it for anything useful. The useful part weโ€™re interested in is the DACL write operation. Does the write operation occur after being โ€œredirectedโ€ by a directory junction?

Figure 8

Figure 8

In the screenshot above you can see that the DACL permissions are indeed successfully overwritten.

The next question is whether the written DACL is sufficiently permissive to provide the attacker with a path to privilege escalation. Alas, no:

Figure 9 - DACL Permissions before

Figure 9 - DACL Permissions before

Figure 10 - DACL Permissions after Group Policy update and directory junction reparse

Figure 10 - DACL Permissions after Group Policy update and directory junction reparse

After successfully reparsing to several locations, I noticed that when the DACL write process is interrupted abruptly due to the SYSTEM user not having sufficient privileges or due to the fact that the file in question was in use, the permissions written actually granted the low-privileged user Full Control permissions.

Figure 11 - Access error caused DACL to write process to be stopped

Figure 11 - Access error caused DACL to write process to be stopped

One method to force an error is by deleting the junction point before it completes writing the DACL operation. The correct moment to delete the junction point can be detected by using anย opportunistic lock (oplock).

Exploit

We can use this behavior to set file permissions on folders/files (where SYSTEM has full control rights or where SYSTEM is the owner of the file) by using junction points and oplocks.

Figure 12 - Low privileged user has insufficient privileges on VMware Tools folder

Figure 12 - Low privileged user has insufficient privileges on VMware Tools folder

As you can see, we are currently logged in as a regular user with no administrative privileges. In this example, we will try to take control of the VMware Tools file located in C:\Program Files\VMware. Currently, we only have Read/Execute permissions on the folders and the files within.

We create a junction point within the Group Policy cache folder sysvol pointing to C:\Program Files\VMware. The name of junction point should start with $. We also create a second folder with a random file inside. On that random file, we set an OpLock so we can cause an error.

Once the OpLock is triggered, we delete the junction point and release the OpLock. As the DACL write worked only partially and the junction point is deleted, the Full Control permissions are retained. After successful exploitation, the current user has full permission on the target folder and the files within. The user is now able to modify the contents of the file, which results in an escalation of privilege.

Figure 13 โ€“ Low-privileged user has now full permissions on the โ€œVMware Toolsโ€ folder

Figure 13 โ€“ Low-privileged user has now full permissions on the โ€œVMware Toolsโ€ folder

Below you will find a second example where a low-privileged user attempts to hijack files within C:\Windows\System32\config. In this case, the OpLock never triggers, because the operation is halted by a previous file where the DACL write operation fails. However, part of the content within the config folder has the new DACL, including the SAM file.

Figure 14 - Low privileged user has now full permissions on the โ€œSAMโ€ file

Figure 14 - Low privileged user has now full permissions on the โ€œSAMโ€ file

Proof of Concept

Iโ€™ve provided a PoC (https://github.com/thezdi/PoC/tree/master/CVE-2020-16939) which automates the hijack. It should be executed as a low-privileged user without administrative rights.

  1. Extract the PoC to a location on a local hard disk which is writable by a normal user.
  2. Execute the PoC executable file passing one argument, specifying the path to the folder to which you want the junction point to redirect to. For example: FolderTakeover.exeโ€ฏC:\Windows\System32\Tasks

Thanks again to Nabeel for providing this great write-up and PoC. He has contributed several bugs to the ZDI program over the last couple of years, and we certainly hope to see more submissions from him in the future. Until then, follow theย teamย for the latest in exploit techniques and security patches.

...



๐Ÿ“Œ Windows Edge/IE Isolated Private Namespace Insecure DACL Privilege Escalation


๐Ÿ“ˆ 32.73 Punkte

๐Ÿ“Œ [local] - Windows Edge/IE - Isolated Private Namespace Insecure DACL Privilege Escalation (MS16-118)


๐Ÿ“ˆ 32.73 Punkte

๐Ÿ“Œ Windows Edge/IE Isolated Private Namespace Insecure DACL Privilege Escalation


๐Ÿ“ˆ 32.73 Punkte

๐Ÿ“Œ [local] - Windows Edge/IE - Isolated Private Namespace Insecure DACL Privilege Escalation (MS16-118)


๐Ÿ“ˆ 32.73 Punkte

๐Ÿ“Œ WindScribe 1.81 DACL Named Pipe privilege escalation


๐Ÿ“ˆ 30.87 Punkte

๐Ÿ“Œ CVE-2022-30205 | Microsoft Windows up to Server 2022 Group Policy Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37955 | Microsoft Windows up to Server 2022 Azure Edition Core Hotpatch Group Policy Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37999 | Microsoft Windows up to Server 2022 Group Policy Preference Client Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37993 | Microsoft Windows up to Server 2022 Group Policy Preference Client Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37994 | Microsoft Windows up to Server 2022 Group Policy Preference Client Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37975 | Microsoft Windows up to Server 2022 Group Policy Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-37992 | Microsoft Windows up to Server 2022 Datacenter Azure Edition Group Policy Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2022-41086 | Microsoft Windows up to Server 2022 Datacenter Azure Edition Group Policy Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2023-28276 | Microsoft Windows up to Server 2022 Group Policy Local Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ CVE-2024-20657 | Microsoft Windows up to Server 2022 23H2 Group Policy Local Privilege Escalation


๐Ÿ“ˆ 26.03 Punkte

๐Ÿ“Œ Microsoft Windows up to Server 2019 Group Policy Services Policy privileges management


๐Ÿ“ˆ 25.87 Punkte

๐Ÿ“Œ [dos] Microsoft Windows 7 Kernel - Uninitialized Memory in the Default dacl Descriptor of System Processes Token


๐Ÿ“ˆ 25.33 Punkte

๐Ÿ“Œ Microsoft Windows Kernel DACL Descriptor Uninitialized Memory


๐Ÿ“ˆ 25.33 Punkte

๐Ÿ“Œ Microsoft Windows Task Scheduler .job Import Arbitrary DACL Write


๐Ÿ“ˆ 25.33 Punkte

๐Ÿ“Œ Mozilla Windows Maintenance Service Weak DACL


๐Ÿ“ˆ 25.33 Punkte

๐Ÿ“Œ [local] - Microsoft Windows Group Policy - Privilege Escalation (MS16-072)


๐Ÿ“ˆ 24.85 Punkte

๐Ÿ“Œ Microsoft Windows 7 Group Policy Privilege Escalation


๐Ÿ“ˆ 24.85 Punkte

๐Ÿ“Œ [local] - Microsoft Windows Group Policy - Privilege Escalation (MS16-072)


๐Ÿ“ˆ 24.85 Punkte

๐Ÿ“Œ Microsoft Windows 7 Group Policy Privilege Escalation


๐Ÿ“ˆ 24.85 Punkte

๐Ÿ“Œ Microsoft Windows up to Server 2012 R2 Active Directory Group Policy privilege escalation


๐Ÿ“ˆ 24.85 Punkte

๐Ÿ“Œ CVE-2019-19741 | Electronic Arts Origin 10.5.55.33574 DACL Origin.exe WriteFileEx Named Pipe privileges management


๐Ÿ“ˆ 24.64 Punkte

๐Ÿ“Œ X.Org security advisory: Privilege escalation and file overwrite in X.Org X server 1.19 and later


๐Ÿ“ˆ 24.56 Punkte

๐Ÿ“Œ Borg up to 1.0.8 Archive Name Overwrite privilege escalation


๐Ÿ“ˆ 24.56 Punkte

๐Ÿ“Œ Cisco Policy Suite Policy Builder HTTP Request privilege escalation


๐Ÿ“ˆ 24.26 Punkte

๐Ÿ“Œ Cisco Policy Suite Policy and Charging Rules Function privilege escalation


๐Ÿ“ˆ 24.26 Punkte

๐Ÿ“Œ sssd Group Policy Objects privilege escalation [CVE-2018-16838]


๐Ÿ“ˆ 24.16 Punkte

๐Ÿ“Œ sssd Group Policy Objects privilege escalation [CVE-2018-16838]


๐Ÿ“ˆ 24.16 Punkte

๐Ÿ“Œ General Electric Digital Proficy HMI/SCADA CIMPLICITY bis 8.1 Service DACL Handler erweiterte Rechte


๐Ÿ“ˆ 23.46 Punkte

๐Ÿ“Œ An ACE Up the Sleeve: Designing Active Directory DACL Backdoors


๐Ÿ“ˆ 23.46 Punkte

๐Ÿ“Œ #0daytoday #WPS Office 10.2.0.5978 - NULL DACL grants full access Vulnerability [remote #exploits #Vulnerability #0day #Exploit]


๐Ÿ“ˆ 23.46 Punkte











matomo