Skip to content
Misconfiguration Write-up Intermediate

Evade Windows Defender Mimikatz Detection By Patching The Amsi Dll

The article demonstrates how to bypass Windows Defender's AMSI detection by patching the amsi.dll in memory, allowing the execution of Mimikatz to dump password hashes. An attacker with local administrator privileges could use this to extract credentials and perform pass-the-hash attacks.

Nol White Hat Follow

Published on systemweakness.com

Malware detection can be bypassed using several powerful tools. An excellent resource for different kinds of Windows Defender AMSI bypasses can be found on Fabian Mosch’s site https://s3cur3th1ssh1t.github.io/.

Nol White Hat, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the AMSI scanning function can be patched in memory to always return a clean result, bypassing detection.

Impact

An attacker with local administrator privileges could bypass AMSI and dump password hashes, potentially leading to domain administrator compromise.

What the attacker needed

Initial foothold (reverse shell); local Administrator privileges; Domain Administrator logged in session

The fix

Keep antivirus software up to date, as the bypass script may be detected in the future.

How it was found

  1. Start Empire server and client on the attacker machine.
  2. Create an HTTP listener and a launcher.bat stager.
  3. Host the launcher and the AMSI bypass script on a temporary HTTP server.
  4. On the victim, execute a PowerShell one-liner that downloads and runs the AMSI bypass script, then runs the Empire launcher.
  5. Use the Empire agent to run the Mimikatz logonpasswords module and dump password hashes.
  6. Use the Mimikatz pth module with the extracted hash to impersonate the Domain Administrator and access the domain controller's c$ share.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Windows Defender uses a component called AMSI to scan scripts for malicious content. This article shows how an attacker can modify a file in memory so that AMSI always says 'clean', letting malicious tools like Mimikatz run without being detected. The attacker needs to already have a foothold on the machine with administrator rights.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Nol White Hat

View all

8 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.