Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / WINDOWS / EVASION

AMSI Bypass

This note documents detection patterns related to AMSI Bypass within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
PowerShell4104Script block loggingCriticalAMSI bypass strings often visible before suppression succeeds.
Security4688Process creationCriticalDetects PowerShell and loader execution.
Sysmon1Process creationCriticalBest lineage source for bypass chains.
Sysmon7Image loadedHighSuspicious memory patching helpers / DLL loads.
Sysmon10Process accessHighMemory writes into scripting processes.
Sysmon11File createMediumLoader dropped before bypass.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Known AMSI stringsAmsiUtils, amsi.dll, AmsiScanBufferCriticalClassic bypass footprint.
Reflection patchingMemory write to AMSI functionCriticalStrong evasion clue.
PowerShell suddenly loses telemetry depthReduced visibilityCriticalOperational symptom.
Encoded PowerShell before suspicious executionStaged bypassCriticalCommon attacker pattern.
DLL patching in script hostAMSI disabled in runtimeHighValuable anomaly.
Loader then script executionStaged evasion chainHighStrong sequence

Common Tools

ToolUsage
PowerShellReflection AMSI bypass
Cobalt StrikeBuilt-in AMSI bypass
custom loadersIn-memory AMSI patching
.NET loadersReflection-based suppression

Relevant Artifacts

  • PowerShell 4104
  • Security Event ID 4688
  • Sysmon Event IDs 1, 7, 10, 11
  • Strings:
    • AmsiScanBuffer
    • amsi.dll
    • AmsiUtils
  • Process memory context
  • EDR script telemetry

MITRE ATT&CK References

  • T1562.001 Impair Defenses

Decision Tree

  1. Which process?

    • powershell
    • wscript
    • loader
  2. Which bypass style?

    • Reflection
    • Patch
    • DLL tamper
  3. Script observed before suppression?

    • Encoded
    • Plaintext
    • Loader chain
  4. Follow-on execution?

    • Payload
    • Injection
    • Download
  5. Expand:

    • Defender tampering
    • ETW tampering
    • LOLBIN chain
  6. Scope:

    • Single bypass
    • Repeated framework behavior
    • Campaign pattern

Example Detection Templates

KQL

PowerShell
| where EventID == 4104
| where ScriptBlockText has_any ("AmsiUtils","AmsiScanBuffer","amsi.dll")
| project TimeGenerated, Computer, ScriptBlockText
SecurityEvent
| where EventID == 4688
| where NewProcessName endswith "powershell.exe"
| project TimeGenerated, Computer, CommandLine

EQL

process where process.command_line like "*Amsi*" 
sequence by host.name with maxspan=5m
  [ process where process.name == "powershell.exe" ]
  [ process where process.command_line like "*Amsi*" ]

Sigma

title: AMSI Bypass Detection
id: 2b7d5a12-amsi-bypass
status: experimental
description: Detects common AMSI bypass strings in PowerShell
references:
  - https://attack.mitre.org/
author: Vergil
date: 2026-03-07
logsource:
  product: windows
  service: powershell
detection:
  selection:
    ScriptBlockText|contains:
      - 'AmsiUtils'
      - 'AmsiScanBuffer'
      - 'amsi.dll'
  condition: selection
fields:
  - ScriptBlockText
falsepositives:
  - Security research
level: high
tags:
  - attack.defense_evasion

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Preserve 4104Critical visibilityCriticalCore AMSI signal
Alert on AMSI stringsLow false positivesCriticalHigh-value detection
Watch memory tamperingPatch detectionHighStrong enrichment
Correlate with payload launchConfirm malicious chainCriticalStrong triage
Harden PowerShell policyReduce abuseHighPrevent execution