githubEdit

Kernel Exploits

Kernel Exploits

This sitearrow-up-right is handy for searching out detailed information about Microsoft security vulnerabilities.

Exploit HiveNightmare

CVE-2021-36934: this vulnerability allow any user to reed Register files (SAM SYSTE. Security hives)

Checking Permissions on the SAM File

to confirm SAM readable for BUILTIN\Users

C:\htb> icacls c:\Windows\System32\config\SAM

C:\Windows\System32\config\SAM BUILTIN\Administrators:(I)(F)
                               NT AUTHORITY\SYSTEM:(I)(F)
                               **BUILTIN\Users:(I)(RX)**
                               APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(I)(RX)
                               APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES:(I)(RX)

Successfully processed 1 files; Failed processing 0 files

Performing Attack and Parsing Password Hashes

we use this tool to copy sensitive file from shadow copies to local path

These copies can then be transferred back to the attack host, where impacket-secretsdump is used to extract the hashes:

Sign With Administrator account



Exploit PrintNightmare

CVE-2021-1675/CVE-2021-34527

vulnerability in function RpcAddPrinterDriver at Print Spooler service

SeLoadDriverPrivilege the ability to add drivers to a remote Print Spooler. This right is typically reserved for users in the built-in Administrators group and Print Operators who may have a legitimate need to install a printer driver on an end user's machine remotely.

Checking for Spooler Service

We can quickly check if the Spooler service is running with the following command. If it is not running, we will receive a "path does not exist" error.

Adding Local Admin with PrintNightmare PowerShell PoC

First start by bypassingarrow-up-right the execution policy on the target host:

Now we can import the PowerShell script and use it to add a new local admin user.

Confirming New Admin User



Enumerating Missing Patches

The first step is looking at installed updates and attempting to find updates that may have been missed, thus, opening up an attack path for us.

Examining Installed Updates

We can examine the installed updates in several ways. Below are three separate commands we can use.

Viewing Installed Updates with WMI

We can search for each KB (Microsoft Knowledge Base ID number) in the Microsoft Update Catalogarrow-up-right to get a better idea of what fixes have been installed and how far behind the system may be on security updates. A search for KB5000808 shows us that this is an update from March of 2021, which means the system is likely far behind on security updates.



CVE-2020-0668 Example

this vulnerability allow to Privileged File Write in protected folder C:\Windows\System32 but it need another vulnerability to run DLL

We will exploit vulnerability with Mozilla Maintenance Service. https://github.com/RedCursorSecurityConsulting/CVE-2020-0668

Checking Permissions on Binary

Generating Malicious Binary

Running the Exploit

Checking Permissions of New File

Last updated