Multi-Base64 Decoding Attempt from Suspicious Location

This rule detects the execution of multiple base64 decoding commands to decode data. multi-decoded data is suspicious, and may be used by attackers to obfuscate malicious payloads or commands.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2025/07/24"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2025/07/24"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10This rule detects the execution of multiple base64 decoding commands to decode data. multi-decoded
 11data is suspicious, and may be used by attackers to obfuscate malicious payloads or commands.
 12"""
 13from = "now-9m"
 14index = ["logs-endpoint.events.process*"]
 15language = "eql"
 16license = "Elastic License v2"
 17name = "Multi-Base64 Decoding Attempt from Suspicious Location"
 18risk_score = 21
 19rule_id = "03d856c2-7f74-4540-a530-e20af5e39789"
 20setup = """## Setup
 21
 22This rule requires data coming in from Elastic Defend.
 23
 24### Elastic Defend Integration Setup
 25Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 26
 27#### Prerequisite Requirements:
 28- Fleet is required for Elastic Defend.
 29- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 30
 31#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 32- Go to the Kibana home page and click "Add integrations".
 33- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 34- Click "Add Elastic Defend".
 35- Configure the integration name and optionally add a description.
 36- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 37- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 38- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 39- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 40For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 41- Click "Save and Continue".
 42- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 43For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 44"""
 45severity = "low"
 46tags = [
 47    "Domain: Endpoint",
 48    "OS: Linux",
 49    "Use Case: Threat Detection",
 50    "Tactic: Defense Evasion",
 51    "Tactic: Execution",
 52    "Data Source: Elastic Defend",
 53]
 54type = "eql"
 55query = '''
 56sequence by process.parent.entity_id with maxspan=3s
 57  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.executable != null and
 58   process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and
 59   // Only including potentially suspicious locations
 60   process.args like~ ("-d*", "--d*") and process.working_directory like (
 61     "/tmp/*", "/var/tmp*", "/dev/shm/*", "/var/www/*", "/home/*", "/root/*"
 62   ) and not (
 63     process.parent.executable in (
 64       "/usr/share/ec2-instance-connect/eic_curl_authorized_keys", "/etc/cron.daily/vivaldi",
 65       "/etc/cron.daily/opera-browser"
 66     ) or
 67     process.working_directory like (
 68       "/opt/microsoft/omsagent/plugin", "/opt/rapid7/ir_agent/*", "/tmp/newroot/*"
 69      )
 70   )]
 71  [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.executable != null and
 72   process.name in ("base64", "base64plain", "base64url", "base64mime", "base64pem", "base32", "base16") and
 73   process.args like~ ("-d*", "--d*")]
 74'''
 75
 76[[rule.threat]]
 77framework = "MITRE ATT&CK"
 78
 79  [rule.threat.tactic]
 80  name = "Defense Evasion"
 81  id = "TA0005"
 82  reference = "https://attack.mitre.org/tactics/TA0005/"
 83
 84    [[rule.threat.technique]]
 85    name = "Obfuscated Files or Information"
 86    id = "T1027"
 87    reference = "https://attack.mitre.org/techniques/T1027/"
 88
 89    [[rule.threat.technique]]
 90    name = "Deobfuscate/Decode Files or Information"
 91    id = "T1140"
 92    reference = "https://attack.mitre.org/techniques/T1140/"
 93
 94[[rule.threat]]
 95framework = "MITRE ATT&CK"
 96
 97  [rule.threat.tactic]
 98  name = "Execution"
 99  id = "TA0002"
100  reference = "https://attack.mitre.org/tactics/TA0002/"
101
102    [[rule.threat.technique]]
103    id = "T1059"
104    name = "Command and Scripting Interpreter"
105    reference = "https://attack.mitre.org/techniques/T1059/"
106
107      [[rule.threat.technique.subtechnique]]
108      name = "Unix Shell"
109      id = "T1059.004"
110      reference = "https://attack.mitre.org/techniques/T1059/004/"
111
112    [[rule.threat.technique]]
113    name = "User Execution"
114    id = "T1204"
115    reference = "https://attack.mitre.org/techniques/T1204/"
116
117      [[rule.threat.technique.subtechnique]]
118      name = "Malicious File"
119      id = "T1204.002"
120      reference = "https://attack.mitre.org/techniques/T1204/002/"```

Related rules

to-top