Detection rules › Sigma

Potential AMSI Bypass Via .NET Reflection

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Markus Neis, @Kostastsale
Source
github.com/SigmaHQ/sigma

Detects Request to "amsiInitFailed" that can be used to disable AMSI Scanning

MITRE ATT&CK coverage

TacticTechniques
Defense ImpairmentT1685 Disable or Modify Tools

Event coverage

Rule body yaml

title: Potential AMSI Bypass Via .NET Reflection
id: 30edb182-aa75-42c0-b0a9-e998bb29067c
related:
    - id: 4f927692-68b5-4267-871b-073c45f4f6fe
      type: obsolete
status: test
description: Detects Request to "amsiInitFailed" that can be used to disable AMSI Scanning
references:
    - https://s3cur3th1ssh1t.github.io/Bypass_AMSI_by_manual_modification/
    - https://www.mdsec.co.uk/2018/06/exploring-powershell-amsi-and-logging-evasion/
author: Markus Neis, @Kostastsale
date: 2018-08-17
modified: 2023-02-03
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - CommandLine|contains|all:
              - 'System.Management.Automation.AmsiUtils'
              - 'amsiInitFailed'
        - CommandLine|contains|all:
              - '[Ref].Assembly.GetType'
              - 'SetValue($null,$true)'
              - 'NonPublic,Static'
    condition: selection
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    - CommandLine|contains|all:
          - 'System.Management.Automation.AmsiUtils'
          - 'amsiInitFailed'
    - CommandLine|contains|all:
          - '[Ref].Assembly.GetType'
          - 'SetValue($null,$true)'
          - 'NonPublic,Static'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • NonPublic,Static
  • SetValue($null,$true)
  • System.Management.Automation.AmsiUtils
  • [Ref].Assembly.GetType
  • amsiInitFailed