Detection rules › Sigma

Suspicious IO.FileStream

Status
test
Severity
medium
Log source
category ps_script, product windows
Author
frack113
Source
github.com/SigmaHQ/sigma

Open a handle on the drive volume via the \.\ DOS device path specifier and perform direct access read of the first few bytes of the volume.

Known false positives

  • Legitimate PowerShell scripts

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Suspicious IO.FileStream
id: 70ad982f-67c8-40e0-a955-b920c2fa05cb
status: test
description: Open a handle on the drive volume via the \\.\ DOS device path specifier and perform direct access read of the first few bytes of the volume.
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1006/T1006.md
author: frack113
date: 2022-01-09
modified: 2022-03-05
tags:
    - attack.stealth
    - attack.t1070.003
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - New-Object
            - IO.FileStream
            - '\\\\.\\'
    condition: selection
falsepositives:
    - Legitimate PowerShell scripts
level: medium

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    ScriptBlockText|contains|all:
        - New-Object
        - IO.FileStream
        - '\\\\.\\'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
ScriptBlockTextmatch
  • IO.FileStream
  • New-Object corpus 8 (sigma 7, splunk 1)
  • \\\\.\\
field:"ScriptBlockText" kind:match