Detectionmediumtest

Suspicious FromBase64String Usage On Gzip Archive - Ps Script

Detects attempts of decoding a base64 Gzip archive in a PowerShell script. This technique is often used as a method to load malicious content into memory afterward.

Open in Detection LabConvert ruleBuild Package
François HubautCreated 2022-12-23df69cb1d-b891-4cd9-90c7-d617d90100cewindows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script

Definition

Requirements: Script Block Logging must be enabled

Detection Logic
Detection Logic1 selector
detection:
    selection:
        ScriptBlockText|contains|all:
            - 'FromBase64String'
            - 'MemoryStream'
            - 'H4sI'
    condition: selection
False Positives

Legitimate administrative script

Testing & Validation

Regression Tests

by frack113
Positive Detection Test1 matchevtx

Microsoft-Windows-PowerShell

Rule Metadata
Rule ID
df69cb1d-b891-4cd9-90c7-d617d90100ce
Status
test
Level
medium
Type
Detection
Created
2022-12-23
Path
rules/windows/powershell/powershell_script/posh_ps_frombase64string_archive.yml
Raw Tags
attack.command-and-controlattack.t1132.001
View on GitHub