The php_uname rule detects potential adversary behavior involving the execution of PHP scripts to gather system information, which may indicate reconnaissance or initial compromise. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify early-stage threats that could lead to deeper system infiltration.
YARA Rule
rule php_uname {
strings:
$ = "php_uname()"
condition:
any of them and filesize < 500KB
}
This YARA rule can be deployed in the following contexts:
Scenario: System Information Gathering via php_uname() in Development Environment
Description: A developer uses php_uname() in a local or staging environment to retrieve system information for debugging or testing.
Filter/Exclusion: Exclude traffic from known development IP ranges or internal hosts (e.g., src_ip in {10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16}).
Scenario: Scheduled Cron Job to Check Server Status
Description: A scheduled cron job runs a PHP script that uses php_uname() to check server status or log system information for monitoring purposes.
Filter/Exclusion: Exclude requests with known cron job patterns (e.g., request_uri contains "/cron/check-status" or user_agent contains "cron").
Scenario: Admin Task to Verify PHP Environment Configuration
Description: A system administrator runs a PHP script to verify the server’s environment variables or PHP configuration for troubleshooting.
Filter/Exclusion: Exclude requests originating from admin workstations (e.g., src_ip in {10.10.10.0/24}) or scripts with known admin tool signatures (e.g., request_uri contains "/admin/phpinfo").
Scenario: Integration with Monitoring Tools (e.g., Nagios, Zabbix)
Description: A PHP script is used as part of an integration with monitoring tools that require system information for health checks.
Filter/Exclusion: Exclude traffic from known monitoring tool IPs or user agents (e.g., user_agent contains "Nagios" or "Zabbix").
Scenario: Legacy Application Using php_uname() for Compatibility
Description: An older PHP application uses `