Potential PHP Reverse Shell
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.
Query · sigma
selection: Image|contains: /php CommandLine|contains|all: - ' -r ' - fsockopen CommandLine|contains: - ash - bash - bsh - csh - ksh - pdksh - sh - tcsh - zsh condition: selection
Known false positives
- Unknown