Detection rules › Splunk

File Execution (Unix)

Group by
_time, command_line, host
Source
github.com/anvilogic-forge/armory

Detect when a file has been executed

MITRE ATT&CK coverage

Telemetry coverage

Rule body

id: '1125.1203'
title: File Execution (Unix)
description: 'Detect when a file has been executed -- Threat Actor Association: TeamTNT,
  Winnti Group - Software Association: Mélofée, Ransom Cartel -- Atomics T1548.003
  Test#1 Atomics T1548.003 Test#2'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_unix` (type=execve OR type=proctitle
  OR sourcetype=bash_history) AND ("./" OR "/") AND NOT ("/usr/bin/" OR "/bin/" OR
  "/sbin/" OR "/usr/libexec/") | rex field=_raw "(?i)proctitle\=(?<command_type>\.\/.+)"|
  eval process=mvappend(process, command_type)| regex process="^(\.)?\/.+" | table
  _time, host, user process | bin span=300s | stats values(*) as * by _time, host,process
  | eventstats dc(host) as dc_host, c(process) as c_process by process| where dc_host=1
  and c_process<3 '
techniques:
- execution:command and scripting interpreter:unix shell
technique_id:
- T1059.004
data_category:
- Process command-line parameters
- Linux audit logs
references: null

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_unix` (type=execve OR type=proctitle OR sourcetype=bash_history) AND ("./" OR "/") AND NOT ("/usr/bin/" OR "/bin/" OR "/sbin/" OR "/usr/libexec/")

Stage 2: rex

| rex field=_raw "(?i)proctitle\=(?<command_type>\.\/.+)"

Stage 3: eval

| eval process=mvappend(process, command_type)

Stage 4: regex

| regex process="^(\.)?\/.+"

Stage 5: table

| table _time, host, user process

Stage 6: bucket

| bin span=300s

Stage 7: stats

| stats values(*) as * by _time, host,process

Stage 8: eventstats

| eventstats dc(host) as dc_host, c(process) as c_process by process

Stage 9: where

| where dc_host=1 and c_process<3

Indicators

These rows show field, operator, and value matches.

Search terms

These SPL tokens match against raw event text.

StageTerm
1"./"
1"/"