Unusual Child Process Execution by Web Servers on Linux
This detection rule identifies suspicious child process executions originating from web server processes on Linux systems, indicating that attackers may have exploited web application vulnerabilities such as command injection or remote file inclusion to establish persistence or execute malicious commands.
What's new
This brief describes a detection mechanism designed to identify unusual child process executions spawned by web server processes on Linux systems. Attackers frequently exploit vulnerabilities in internet-facing web applications, such as command injection, remote file inclusion, or deserialization flaws, to gain initial access and establish persistence. Once a web server (e.g., Apache, NGINX, or various application servers like those based on Python, Ruby, or Java) is compromised, attackers often leverage its privileges to launch atypical child processes. These child processes might include shells, script interpreters, downloaders like curl or wget, or archive utilities, which deviate significantly from the web server's normal operational behavior. Such activity serves as a strong indicator that the system has been compromised and is being used for further malicious actions like installing backdoors, exfiltrating data, or deploying additional tooling.
Attack Chain
- Initial Access: An attacker exploits a vulnerability (e.g., command injection, remote file inclusion, deserialization flaw) in a public-facing web application running on a Linux server.
- Web Server Process Execution: The successful exploit causes the compromised web server process (e.g.,
nginx,apache2,php-fpm,javafor a Java application server) to spawn an unusual child process. - Command and Scripting Interpreter Execution: The child process is typically a shell (
bash,sh), a scripting interpreter (python,perl,ruby), or a utility designed to execute arbitrary commands. - Payload Delivery: The newly spawned child process executes commands to download additional tools or payloads from attacker-controlled infrastructure using utilities like
curlorwget. - Persistence Establishment: Downloaded tools or executed commands establish persistence mechanisms such as web shells (e.g., in
/var/www/), new scheduled tasks (cron jobs), modified SSH authorized keys, or system service entries. - Lateral Movement/Data Exfiltration: The attacker uses the persistent access to perform privilege escalation, collect credentials, move laterally within the network, or exfiltrate sensitive data.
- Impact: The final objective typically involves full system compromise, data breach, or deployment of further malware such as ransomware.
Impact
Successful exploitation leading to unusual child process execution can result in severe consequences, including full compromise of the affected web server and potentially the broader network. Attackers can leverage the compromised web server's context to install backdoors, escalate privileges, exfiltrate sensitive data, or deploy ransomware. This can lead to significant data breaches, disruption of services, reputational damage, and financial losses. The scope of impact extends to any data handled by the web application or accessible from the compromised server. Without timely detection and remediation, attackers can establish long-term persistence and expand their control over the organization's infrastructure.
Recommendation
- Deploy the Sigma rule "Detect Unusual Child Execution by Web Server Process on Linux" to your SIEM and tune for your environment to identify deviations from normal web server behavior.
- Review the full parent-to-descendant execution chain for alerts generated by
process_creationlogs from Linux endpoints to understand the sequence of actions. - Correlate process start times with
webserveraccess, error, reverse-proxy, and WAF logs to identify the triggering request, source IP, requested path, and signs of exploitation like command injection. - Examine activity under the web service account (e.g.,
process.parent.namerelated accounts) around the alert for suspicious file writes, new scheduled tasks, privilege escalation attempts, or unusual outboundnetwork_connectionlogs. - Harden the environment by patching exploited web components, disabling unnecessary script execution from upload and web content directories, enforcing least privilege for web service accounts, and restricting outbound network access.
Detection coverage 2
Detect Unusual Child Execution by Web Server Process on Linux
mediumDetects web server processes spawning unusual child processes, which can indicate compromise through vulnerabilities like command injection or remote file inclusion, used for persistence or further execution.
Detect Potential SUID/SGID Privilege Escalation on Linux
highDetects potential privilege escalation under the root effective user or group when the real user or parent user/group are not root, indicative of the execution of binaries with SUID or SGID bits set. This rule filters for suspicious parent processes and excludes known legitimate SUID/SGID binaries.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
10
domain
3
ip
| Type | Value |
|---|---|
| ip | 0.0.0.0 |
| ip | 169.254.169.254 |
| ip | 168.63.129.16 |
| domain | mcr.microsoft.com |
| domain | acs-mirror.azureedge.net |
| domain | packages.aks.azure.com |
| domain | packages.microsoft.com |
| domain | login.microsoftonline.com |
| domain | management.azure.com |
| domain | storage.googleapis.com |
| domain | api.github.com |
| domain | artifacts.elastic.co |
| domain | download.elastic.co |