Skip to content
Threat Feed
low advisory

Anomalous Linux Compiler Activity Detection

Elastic has developed a machine learning detection rule to identify anomalous compiler activity on Linux systems, which can indicate unauthorized software deployment, ad-hoc changes, or privilege escalation attempts by adversaries.

Elastic has released a machine learning detection rule designed to identify anomalous compiler activity in Linux environments. This rule, known as v3_linux_rare_user_compiler_ea, is triggered when a user context that typically does not execute compilers suddenly begins doing so. Such activity can be a strong indicator of unauthorized software changes, illicit software deployment, or local privilege escalation attempts. Adversaries may leverage compilers to compile and deploy custom malware, exploits, or rootkits on compromised systems. The detection relies on data ingested from integrations like Elastic Defend, Auditd Manager, or Network Packet Capture and utilizes entity analytics to establish baselines of normal user behavior, flagging significant deviations. While rated with low severity, this activity warrants investigation as it can precede or accompany more severe malicious actions in a Linux environment.

Attack Chain

This brief describes a detection capability rather than a specific attack chain. However, anomalous compiler activity observed on a system often occurs during the following stages of an attack:

  1. Initial Access / Execution: An attacker gains initial access and executes a payload that might include a compiler or a script to download and compile malicious code.
  2. Persistence: An attacker compiles a backdoor or other persistent mechanism to maintain access.
  3. Privilege Escalation: An attacker compiles and executes a local exploit (e.g., a kernel exploit) to elevate privileges on the compromised system, often leveraging make or gcc.
  4. Defense Evasion: Compiling custom tools or modified versions of legitimate tools to evade detection by security software.
  5. Resource Development: An attacker may use compilers to build tools or malware directly on a compromised system for further stages of attack.
  6. Impact: The compiled malicious code is executed, leading to data exfiltration, system compromise, or other objectives.

Impact

Successful exploitation indicated by anomalous compiler activity can lead to significant consequences including unauthorized system modifications, deployment of malicious software (such as backdoors or rootkits), and local privilege escalation. This can grant attackers deeper control over the compromised system, facilitate lateral movement, enable data theft, or disrupt critical services. While this specific rule flags an indicator rather than a direct impact, unaddressed anomalous compiler use can be a precursor to or component of a more severe breach.

Recommendation

  • Deploy the v3_linux_rare_user_compiler_ea machine learning job and ensure data is being ingested from Elastic Defend, Auditd Manager, or Network Packet Capture integrations to activate the Anomalous Linux Compiler Activity detection rule.
  • Review and tune the Anomalous Linux Compiler Activity detection rule's false positive scenarios for your environment, considering legitimate use cases such as development environments, automated build systems, or scheduled maintenance.
  • Establish a clear process for users to notify security teams of legitimate compiler usage to proactively reduce false positives.
  • For alerts generated by Anomalous Linux Compiler Activity, initiate an investigation to review the user account, specific compiler, source/destination of activity, recent system changes, and audit trails for signs of privilege escalation or other suspicious actions.
  • Implement incident response procedures, such as isolating affected systems, terminating suspicious processes, and conducting thorough forensic analysis, upon confirmation of malicious compiler activity.