AMSI patch → in-memory .NET / PowerShell stager
Patch AmsiScanBuffer in amsi.dll → return clean for any content. Subsequent PowerShell / Office VBA / .NET runtime calls emit attacker code without scanning.
§ Context
Assumed environment: medium-integrity foothold. Attacker has the ability to start a PowerShell session or load .NET assembly in their own process. AV relies on AMSI for in-memory script scanning.
§ Steps
- 01Medium-integrity shellInitial AccessT1078— Valid Accounts
- 02C2 beacon establishedCommand and ControlT1071— Application Layer Protocol
- 03Persistence via WMI subscriptionPersistenceLOL-SCRCONS— scrcons.exe WMI Event Subscription
- 04Patch amsi.dll!AmsiScanBufferDefense EvasionAMSI-PATCH— AMSI In-Memory Patch
- 05Patch ntdll!EtwEventWrite to blind ETWDefense EvasionETW-PATCH— ETW Event-Tracing Patch
- 06Load .NET stager via Assembly.LoadDefense EvasionINJ-MODULE-STOMP— Module Stomping
§ References
- T1078Valid Accounts
- T1071Application Layer Protocol
§ Frequently asked
- What is the "AMSI patch → in-memory .NET / PowerShell stager" attack path?
- Patch AmsiScanBuffer in amsi.dll → return clean for any content. Subsequent PowerShell / Office VBA / .NET runtime calls emit attacker code without scanning. It chains 6 steps drawn from real-world offensive-security techniques.
- What starting position does this attack require?
- The first step is Medium-integrity shell (T1078) — a initial access primitive. Assumed environment: medium-integrity foothold.
- What is the final impact of this kill-chain?
- The final step lands on Load .NET stager via Assembly.Load (INJ-MODULE-STOMP), which falls under Defense Evasion. From here, an operator typically pivots into post-exploitation or maintains persistence.
- How can defenders detect or prevent this attack?
- Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.
§ Related dossiers
- Shared techniques2
Build-system implant → signed supply-chain backdoor (SolarWinds-class)
Compromise the target vendor's build server. A small implant rewrites a single source file at compile time — every official signed release downstream now ships the backdoor.
- Shared techniques2
Process hollowing → run beacon in svchost shell
Spawn svchost.exe suspended, unmap its image, write attacker PE into the same address space, resume — the process keeps a legit-looking PEB and command line but executes beacon code.
- Shared techniques2
certutil + bitsadmin → AV-friendly stager chain
Initial access dropped a tiny .bat. It uses certutil to decode a base64 blob and bitsadmin to fetch the real beacon, then schtasks for persistence. Every binary is signed Microsoft.
- Shared techniques2
Autodiscover external leak → credential harvest
Mis-implemented Autodiscover falls back to autodiscover.<TLD>; register that domain externally, harvest plaintext Basic-auth credentials from clients that haven't been patched / configured properly.