If you opened Twitter today you were probably flooded with news about the latest security issue with Windows. For those that have ISC as their home page (yay!) the issue is the following: apparently starting with Windows 10 1809 (hey, that’s a version from 2018) Microsoft messed up permissions on the SAM and SYSTEM hives which became readable for any user on the system. This can be easily checked on your system with the icacls utility, as shown above for my test Windows:
The only issue here is how do we read those files: when Windows are running, the access to the files is locked and even though we have read permission, we won’t be able to read them. As two great researchers found (@jonasLyk and @gentilkiwi), we can actually abuse Volume Shadow Copy to read the files. VSS will allow us to bypass the file being locked, and since we have legitimate read access, there’s nothing preventing us from reading the file. VSS is a feature that is enabled automatically on Windows and that allows us to restore previous copies in case something got messed up during installation of a new application or patch, for example. If your system disk is greater than 128 GB, it will be enabled automatically! Now, as a standard user (without local administrator privileges), one cannot check what VSS copies exist, so let’s see what can be done. As shown above, I have one VSS with the path of \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1. And due to incorrect permissions set on the SYSTEM and SAM hives, I can now simply try to copy these files from the VSS. While the built-in copy command will not work, there are other ways to do this - @gentilkiwi used Mimikatz (of course ?), and below is a simple C program compiled that literally takes one argument and copies the file to destination (thanks to my colleague @filip_dragovic for help):
What if you don’t know which VSS copy you have? Don’t worry – Windows actually increments the number at the end, so just brute force them! Mitigation To be honest – I’m not sure what’s the best way to mitigate this currently, apart from disabling/removing VSS copies. Keep in mind that the permission on the hives will still be wrong, but at least a non-privileged user will not be able to easily fetch these files due to them being locked by Windows as the system is running. We’ll be keeping an eye on this, of course, if you have any additional information let us know! I will be teaching next: Web App Penetration Testing and Ethical Hacking - SANS Pen Test Hackfest Europe 2022 - Berlin |
Bojan 402 Posts ISC Handler Jul 20th 2021 |
Thread locked Subscribe |
Jul 20th 2021 10 months ago |
Can you share the copy script Filip made?
|
Jack 8 Posts |
Quote |
Jul 20th 2021 10 months ago |
Quoting Jack:Can you share the copy script Filip made? Sure - it's here: pastebin.com/raw/… Just compile it and off you go. |
Bojan 402 Posts ISC Handler |
Quote |
Jul 20th 2021 10 months ago |
Does this effect any server versions for Microsoft or only Win10/11?
|
Anonymous |
Quote |
Jul 20th 2021 10 months ago |
Quoting Anonymous:Does this effect any server versions for Microsoft or only Win10/11? Luckily servers are not affected, only Win10/11. |
Bojan 402 Posts ISC Handler |
Quote |
Jul 20th 2021 10 months ago |
My Win10 21H1 (OS build 19043.1110) does not seem have this issue, but is not on a Domain (if that makes a difference).
|
Anonymous |
Quote |
Jul 21st 2021 10 months ago |
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36934
|
Anonymous |
Quote |
Jul 21st 2021 10 months ago |
Our testing shows you can mitigate it by running "icalcs %windir%\system32\config\*.* /inheritance:e" and then delete your old VSS copies with "vssadmin delete shadows /all /quiet". New VSS copies moving forward will not have the permission issue.
|
Jeremiah 2 Posts |
Quote |
Jul 21st 2021 10 months ago |
How can we check on a mass scale if our systems are vulnerable? Also what would be the registry settings to modify via Group Policy to make the changes, again on a mass scale?
|
AAInfoSec 51 Posts |
Quote |
Jul 21st 2021 10 months ago |
This is now CVE-2021-36934 and Microsoft has suggested a workaround:
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36934 |
Anonymous |
Quote |
Jul 21st 2021 10 months ago |
Anonymous |
|
Quote |
Jul 22nd 2021 10 months ago |
Sign Up for Free or Log In to start participating in the conversation!