Skip to content

Add Windows Defender BlueHammer LPE exploit (CVE-2026-33825)#21521

Draft
anasabugaddara-ux wants to merge 9 commits into
rapid7:masterfrom
anasabugaddara-ux:add-bluehammer-cve-2026-33825
Draft

Add Windows Defender BlueHammer LPE exploit (CVE-2026-33825)#21521
anasabugaddara-ux wants to merge 9 commits into
rapid7:masterfrom
anasabugaddara-ux:add-bluehammer-cve-2026-33825

Conversation

@anasabugaddara-ux

@anasabugaddara-ux anasabugaddara-ux commented May 31, 2026

Copy link
Copy Markdown

Summary

This PR adds a new local privilege escalation exploit module targeting CVE-2026-33825 (BlueHammer), a vulnerability in Microsoft Defender Antimalware Platform versions up to (excluding) 4.18.26030.3011.

The exploit abuses a TOCTOU race condition in Defender's remediation engine to elevate privileges to NT AUTHORITY\SYSTEM, enabling extraction of SAM/SYSTEM registry hives for offline hash cracking.

Files Changed

  • modules/exploits/windows/local/blue_hammer.rb – The exploit module
  • documentation/modules/exploits/windows/local/blue_hammer.md – Usage documentation

Verification

  • Start msfconsole
  • use exploit/windows/local/blue_hammer
  • set SESSION <id> (where <id> is an active Meterpreter session on the target)
  • set BASE_DIR C:\Users\Public\Downloads\HammerSpace
  • check → Verify output returns Appears for vulnerable Defender versions
  • exploit → Verify successful privilege escalation to NT AUTHORITY\SYSTEM
  • Confirm SAM/SYSTEM hives are accessible post-exploitation
  • Documentation included per Metasploit guidelines

Testing Environment

  • Target OS: Windows 10/11 (with Defender version 4.18.x)
  • Attacker OS: Kali Linux (latest)
  • Session Type: Meterpreter (x86/x64)

References

@anasabugaddara-ux

Copy link
Copy Markdown
Author

Demo video coming soon—currently resolving lab environment issues.

Comment thread documentation/modules/exploits/windows/local/blue_hammer.md Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
@smcintyre-r7

Copy link
Copy Markdown
Contributor

I've seen no demo sent to the msfdev mailing list, it also looks like that text might have been AI generated. Without proof that this has been tested, we're going to close it out per our polices.

You need to prove that this was tested and working before we'll process it. If you're still working on it, please mark it as a draft.

@anasabugaddara-ux

anasabugaddara-ux commented Jun 1, 2026 via email

Copy link
Copy Markdown
Author

@smcintyre-r7

Copy link
Copy Markdown
Contributor

I'm not seeing the video. This is a public exploit for Windows though so there's not much reason to keep the video private. Please post the video to the PR or at least a screenshot showing the exploit and payload running.

@anasabugaddara-ux

Copy link
Copy Markdown
Author

Hi,
As requested, I have provided the demo of the BlueHammer exploit (CVE-2026-33825) below. The video demonstrates the "check" functionality, the exploit execution loop, and the successful exfiltration of the SAM/SYSTEM hives.

Demo Video: https://drive.google.com/file/d/1-oSDkqtWKPj_ylhVyZzyUM9EM6ZydJ86/view?usp=drive_link

(Note: For a quicker review, feel free to watch the recording at 2x speed.)

Let me know if you need any additional information.

@anasabugaddara-ux

anasabugaddara-ux commented Jun 1, 2026 via email

Copy link
Copy Markdown
Author

@msutovsky-r7 msutovsky-r7 marked this pull request as draft June 1, 2026 20:39
anasabugaddara-ux and others added 6 commits June 2, 2026 04:33
Co-authored-by: Julien Voisin <jvoisin@users.noreply.github.com>
Co-authored-by: Julien Voisin <jvoisin@users.noreply.github.com>
Co-authored-by: Julien Voisin <jvoisin@users.noreply.github.com>

@anasabugaddara-ux anasabugaddara-ux left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jvoisin Thank you for the detailed review! I have addressed all your feedback.
Please let me know if any further changes are needed.

Comment thread documentation/modules/exploits/windows/local/blue_hammer.md Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb Outdated
Comment thread modules/exploits/windows/local/blue_hammer.rb
@dwelch-r7 dwelch-r7 added module rn-modules release notes for new or majorly enhanced modules labels Jun 8, 2026

@msutovsky-r7 msutovsky-r7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this PR and it seems like most of it is AI-generated as module contains errors and it cannot be loaded by framework because of that. After fixing those errors, the module still does not work as expected which leads me to conclusion that you've submitted something you didn't test before. My suggestion here is to fix the issues and make sure to test the code you've submitted. Otherwise, this PR will be closed/taken over by someone else.

system-level access to extract credentials or shadow copies.
},
'License' => MSF_LICENSE,
'Author' => [ 'Anas Abu Ghaddara' ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give creds to the researchers who discovered this: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-33825

current_version = ::Regexp.last_match(1)
print_status("Detected Defender Version: #{current_version}")
if Rex::Version.new(current_version) < Rex::Version.new('4.18.26050.3011')
return Exploit::CheckCode::Appears

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add messages as arguments to CheckCodes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong folder for documentation, it should be documentation/modules/exploit/.. - that leads me to question, if the content Scenarios is actual output of your run of module, because it seems it's missing some information.

Also, you should run ruby tools/dev/msftidy_docs.rb for this documentation and fix the issues it prompts.

check_result = cmd_exec("icacls \"#{target_file}\"")
if check_result.include?('BUILTIN\\Users')
print_good("Success! Privilege escalation confirmed.")
return true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, exploit method does not return true/false and it actually breaks the module:

3041 [06/11/2026 13:42:32] [e(0)] core: /home/ms/git/metasploit-framework/modules/exploits/windows/local/blue_hammer.rb failed      to load - SyntaxError /home/ms/git/metasploit-framework/modules/exploits/windows/local/blue_hammer.rb:105: Invalid retur     n in class/module body
3042      return true
3043      ^~~~~~
3044 /home/ms/git/metasploit-framework/modules/exploits/windows/local/blue_hammer.rb:108: Invalid return in class/module body
3045      return false


# We loop rapidly to catch the precise moment Defender's NT AUTHORITY\SYSTEM thread
# opens the file but before it applies its remediation action.
datastore['ITERATIONS'].times do |i|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ITERATIONS datastore option is not defined

@github-project-automation github-project-automation Bot moved this from Todo to Waiting on Contributor in Metasploit Kanban Jun 11, 2026
@anasabugaddara-ux

Copy link
Copy Markdown
Author

Hi @msutovsky-r7,

Thank you for the detailed review. I have addressed all the structural feedback:

Added messages to all CheckCodes (Appears, Safe, Unknown)
Added ITERATIONS as a configurable datastore option
Removed invalid return true/false from exploit method
Added proper author credits (Zen Dodd, Yuanpei XU)
Moved documentation to correct folder
Fixed all trailing whitespace (msftidy_docs clean)

I am also currently working on improving the reliability of the exploit with Defender fully active. I will update the PR once I have confirmed consistent results.

Please let me know if any further changes are needed on the current fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module rn-modules release notes for new or majorly enhanced modules

Projects

Status: Waiting on Contributor

Development

Successfully merging this pull request may close these issues.

5 participants