Potential PHP Reverse Shell
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…
Description
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.
Detection logic
Detection requirements
- Log source product
- linux
- Log source category
- process_creation
Known benign triggers
- Unknown
MITRE ATT&CK mappings
Not mapped to ATT&CK.
References
| Reference | Cited by |
|---|---|
| pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet | 10 |
| www.revshells.com | 12 |
From the source
- At source
- Open at source
- Upstream identifier
- c6714a24-d7d5-4283-a36b-3ffd091d5f7e
- Tagged by the source as
- attack.execution
Licence
- Published under
- Detection Rule License 1.1Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Aug 26, 2026
- Version
- 1