Techniques
Sample rules
Linux Decode Base64 to Shell
- source: splunk
- technicques:
- T1027
- T1059.004
Description
The following analytic detects the behavior of decoding base64-encoded data and passing it to a Linux shell. Additionally, it mitigates the potential damage and protects the organization’s systems and data.The detection is made by searching for specific commands in the Splunk query, namely “base64 -d” and “base64 –decode”, within the Endpoint.Processes data model. The analytic also includes a filter for Linux shells. The detection is important because it indicates the presence of malicious activity since Base64 encoding is commonly used to obfuscate malicious commands or payloads, and decoding it can be a step in running those commands. It suggests that an attacker is attempting to run malicious commands on a Linux system to gain unauthorized access, for data exfiltration, or perform other malicious actions.
Detection logic
| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process="*
|*" `linux_shells` by Processes.dest Processes.user Processes.parent_process_name Processes.process_name Processes.process Processes.process_id Processes.parent_process_id
| `drop_dm_object_name(Processes)`
| rex field=process "base64\s+(?<decode_flag>-{1,2}d\w*)"
| where isnotnull(decode_flag)
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `linux_decode_base64_to_shell_filter`