← Back to SOC feed Coverage →

Execute Code with Pester.bat as Parent

sigma MEDIUM SigmaHQ
T1059.001T1216
imProcessCreate
powershell
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-05-10T23:00:00Z · Confidence: medium

Hunt Hypothesis

Detects code execution via Pester.bat (Pester - Powershell Modulte for testing)

Detection Rule

Sigma (Original)

title: Execute Code with Pester.bat as Parent
id: 18988e1b-9087-4f8a-82fe-0414dce49878
related:
    - id: 59e938ff-0d6d-4dc3-b13f-36cc28734d4e
      type: similar
status: test
description: Detects code execution via Pester.bat (Pester - Powershell Modulte for testing)
references:
    - https://twitter.com/Oddvarmoe/status/993383596244258816
    - https://twitter.com/_st0pp3r_/status/1560072680887525378
author: frack113, Nasreddine Bencherchali
date: 2022-08-20
tags:
    - attack.execution
    - attack.stealth
    - attack.t1059.001
    - attack.t1216
logsource:
    category: process_creation
    product: windows
detection:
    selection_module:
        ParentImage|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        ParentCommandLine|contains: '\WindowsPowerShell\Modules\Pester\'
    selection_cli:
        ParentCommandLine|contains:
            - '{ Invoke-Pester -EnableExit ;'
            - '{ Get-Help "'
    condition: all of selection_*
falsepositives:
    - Legitimate use of Pester for writing tests for Powershell scripts and modules
level: medium

KQL (Azure Sentinel)

imProcessCreate
| where (((ParentProcessName endswith "\\powershell.exe" or ParentProcessName endswith "\\pwsh.exe") or (ActingProcessName endswith "\\powershell.exe" or ActingProcessName endswith "\\pwsh.exe")) and ActingProcessCommandLine contains "\\WindowsPowerShell\\Modules\\Pester\\") and (ActingProcessCommandLine contains "{ Invoke-Pester -EnableExit ;" or ActingProcessCommandLine contains "{ Get-Help \"")

Required Data Sources

Sentinel TableNotes
imProcessCreateEnsure this data connector is enabled

False Positive Guidance

MITRE ATT&CK Context

References

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_lolbin_pester.yml