T1546.004 Sumo Logic CSE · Sumo

Detect Unix Shell Configuration Modification in Sumo Logic CSE

Adversaries may establish persistence through executing malicious commands triggered by a user's shell. User Unix shells execute several configuration scripts whenever a shell session is opened. Malicious content can be inserted into these shell configuration files — such as ~/.bashrc, ~/.bash_profile, ~/.bash_login, ~/.profile, /etc/profile, /etc/bashrc, ~/.zshrc, and ~/.zprofile — to execute adversary payloads when a user opens a terminal or logs in. The payload will execute in the user's context each time the shell is started.

MITRE ATT&CK

Tactic
Privilege Escalation Persistence
Technique
T1546 Event Triggered Execution
Sub-technique
T1546.004 Unix Shell Configuration Modification
Canonical reference
https://attack.mitre.org/techniques/T1546/004/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
(_sourceCategory=*linux* OR _sourceCategory=*syslog* OR _sourceCategory=*auditd* OR _sourceCategory=*endpoint*)
| parse regex field=_raw "(?:name|path|file)=\"?(?<FilePath>[^\"|\s]+)\"?" nodrop
| parse regex field=_raw "type=PATH.*?name=\"(?<AuditPath>[^\"]+)\"" nodrop
| if (isNull(FilePath), AuditPath, FilePath) as FilePath
| where FilePath matches "*/.bashrc"
  OR FilePath matches "*/.bash_profile"
  OR FilePath matches "*/.bash_login"
  OR FilePath matches "*/.profile"
  OR FilePath matches "*/.zshrc"
  OR FilePath matches "*/.zprofile"
  OR FilePath matches "*/.zshenv"
  OR FilePath matches "*/.zlogin"
  OR FilePath matches "*/.tcshrc"
  OR FilePath matches "*/.cshrc"
  OR FilePath matches "/etc/profile.d/*"
  OR FilePath matches "/etc/bash_completion.d/*"
  OR FilePath = "/etc/profile"
  OR FilePath = "/etc/bashrc"
  OR FilePath = "/etc/bash.bashrc"
  OR FilePath matches "*/.config/fish/config.fish"
| if (FilePath matches "/etc/*", "true", "false") as IsSystemFile
| if (FilePath matches "/root/*", "true", "false") as IsRootHome
| count by _sourceHost, FilePath, IsSystemFile, IsRootHome
| sort by _count desc
high severity medium confidence

Detects modifications to Unix shell configuration startup files by parsing syslog and auditd log sources. Extracts file paths from both structured auditd PATH records (type=PATH name=...) and general syslog messages, then classifies hits as system-wide or per-user modifications across bash, zsh, tcsh, csh, and fish.

Data Sources

Linux Syslog (Sumo Logic Installed Collector)Auditd via Sumo Logic Linux Audit SourceSumo Logic CSE Normalized Endpoint

Required Tables

_sourceCategory=*linux*_sourceCategory=*auditd*

False Positives & Tuning

  • CI/CD pipeline build agents preparing Linux runner environments by writing PATH exports or tool-specific initialization blocks to .bashrc or .profile before executing build steps
  • Linux administrators running configuration management runs that legitimately update /etc/profile.d/ scripts as part of environment standardization across server fleets
  • Shell plugin managers or terminal utility installers (fzf, zoxide, starship, nvm) that append sourcing blocks or eval statements to .zshrc or .bashrc during interactive installation
Download portable Sigma rule (.yml)

Other platforms for T1546.004


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Add Reverse Shell to .bashrc

    Expected signal: File modification event for ~/.bashrc. Process creation for bash with echo command. Auditd SYSCALL records with type=PATH for the .bashrc file write. The reverse shell command in the file content is the key indicator.

  2. Test 2Add Download Cradle to /etc/profile.d/

    Expected signal: File creation event for /etc/profile.d/argus-test.sh. Process creation for tee writing to /etc/profile.d/. Auditd records for the file creation in a privileged directory. The curl | bash pattern in the script content.

  3. Test 3Modify .bash_profile to Add Malicious PATH

    Expected signal: File modification event for ~/.bash_profile. File creation events for ~/.local/bin/ls. The PATH modification in bash_profile is the persistence mechanism — every new shell session adds the attacker directory to PATH first.

Unlock Pro Content

Get the full detection package for T1546.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections