LoFP LoFP / false positives may be present based on legitimate software being utilized. filter as needed.

Techniques

Sample rules

Linux Decode Base64 to Shell

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.action Processes.dest Processes.original_file_name Processes.parent_process Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id Processes.parent_process_name Processes.parent_process_path Processes.process Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id Processes.process_integrity_level Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product 
| `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`