Suspicious Execution of Php Inline Command (via process_creation)

This rule detects execution of php using the "-r" flag. This is could be used as a way to launch a reverse shell or execute live php code.

SigmamediumWindowsv1
sigma
title: Suspicious Execution of Php Inline Command (via process_creation)
id: 63cc0e65-0c64-5a10-9fb6-ba84dedce259
status: stable
description: This rule detects execution of php using the "-r" flag. This is could be used as a way to launch a reverse shell or execute live php code.
references:
    - https://attack.mitre.org/techniques/T1059/
    - https://www.php.net/manual/en/features.commandline.php
    - https://www.revshells.com/
    - https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
author: Huntrule Team
date: 2026-03-28
tags:
    - attack.execution
    - attack.t1059
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\php.exe'
        - OriginalFileName: 'php.exe'
    selection_cli:
        CommandLine|contains: ' -r'
    condition: all of selection_*
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.