Sigma rule: Potential PHP Reverse Shell
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-b7bb911dddc4, updated 2023-04-07T00:00:00.000Z.
Rule
- Title
- Potential PHP Reverse Shell
- Status
- test
- Level
- high
- Author
- @d4ns4n_
- Date
- 2023-04-07
- File
- rules/linux/process_creation/proc_creation_lnx_php_reverse_shell.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects usage of the PHP CLI with the "-r" flag which allows it to run inline PHP code. The rule looks for calls to the "fsockopen" function which allows the creation of sockets.
Attackers often leverage this in combination with functions such as "exec" or "fopen" to initiate a reverse shell connection.
Log source
- product
- linux
- category
- process_creation
Detection
selection:
Image|contains: '/php'
CommandLine|contains|all:
- ' -r '
- 'fsockopen'
CommandLine|contains:
- 'ash'
- 'bash'
- 'bsh'
- 'csh'
- 'ksh'
- 'pdksh'
- 'sh'
- 'tcsh'
- 'zsh'
condition: selectionFalse positives (as the rule lists them)
- Unknown
Tags
- attack.execution
References
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/linux/process_creation/proc_creation_lnx_php_reverse_shell.yml
Sources and licences
SigmaHQ
"Potential PHP Reverse Shell" by @d4ns4n_ (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/linux/process_creation/proc_creation_lnx_php_reverse_shell.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: Potential PHP Reverse Shell",
entity page, dataset version ref-b7bb911dddc4, updated 2023-04-07T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/c6714a24-d7d5-4283-a36b-3ffd091d5f7e (accessed 2026-11-03).
Underlying source: SigmaHQ rule c6714a24-d7d5-4283-a36b-3ffd091d5f7e, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.