T1547.013 Splunk · SPL

Detect XDG Autostart Entries in Splunk

Adversaries may add or modify XDG Autostart Entries to execute malicious programs or commands when a user's desktop environment is loaded at login. XDG Autostart entries are available for any XDG-compliant Linux system. XDG Autostart entries use Desktop Entry files (.desktop) to configure the user's desktop environment upon user login. These configuration files determine what applications launch upon user login, define associated applications to open specific file types, and define applications used to open removable media. Adversaries may abuse this feature to establish persistence by adding a path to a malicious binary or command to the Exec directive in the .desktop configuration file. System-wide Autostart entries are located in /etc/xdg/autostart while user entries are located in ~/.config/autostart.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1547 Boot or Logon Autostart Execution
Sub-technique
T1547.013 XDG Autostart Entries
Canonical reference
https://attack.mitre.org/techniques/T1547/013/

SPL Detection Query

Splunk (SPL)
spl
index=linux sourcetype=syslog
  ("autostart" AND ".desktop")
| eval is_system_wide=if(match(_raw, "/etc/xdg/autostart/"), 1, 0)
| eval is_user_level=if(match(_raw, "\.config/autostart/"), 1, 0)
| table _time, host, user, _raw, is_system_wide, is_user_level
| sort - _time
| append
  [search index=linux sourcetype="linux:audit" type=SYSCALL
    (name="open" OR name="openat" OR name="creat" OR name="rename")
    (a0="*autostart*" OR a1="*autostart*" OR exe="*")
  | search "autostart" AND ".desktop"
  | table _time, host, auid, uid, exe, name, key
  | sort - _time]
| append
  [search index=linux sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
    TargetFilename="*autostart*.desktop"
  | table _time, host, User, Image, TargetFilename
  | sort - _time]
medium severity medium confidence

Detects XDG Autostart persistence using multiple Linux log sources: (1) syslog entries mentioning autostart .desktop file operations, (2) Linux audit daemon SYSCALL events for file creation/modification operations targeting autostart directories, and (3) Sysmon for Linux Event ID 11 (File Create) for .desktop files in autostart paths. The three-source approach maximizes coverage across different Linux EDR configurations.

Data Sources

File: File CreationFile: File ModificationLinux Audit DaemonSysmon for Linuxsyslog

Required Sourcetypes

sysloglinux:auditXmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Desktop environment package installations (GNOME, KDE, XFCE) adding autostart entries for system services
  • User applications (Slack, Discord, Spotify) creating autostart entries when enabling start-on-login
  • Configuration management tools (Ansible, Puppet) deploying autostart entries for monitoring agents
  • Package manager operations (apt, dnf) installing packages with XDG autostart files
Download portable Sigma rule (.yml)

Other platforms for T1547.013


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 1Create Malicious XDG Autostart Entry (User Level)

    Expected signal: Sysmon for Linux Event ID 11: FileCreate with TargetFilename=~/.config/autostart/df00tech-test.desktop. Audit log: SYSCALL event for openat/creat on the .desktop file path. DeviceFileEvents with ActionType=FileCreated.

  2. Test 2Create System-Wide XDG Autostart Entry

    Expected signal: Sysmon for Linux Event ID 11: FileCreate with TargetFilename=/etc/xdg/autostart/df00tech-sysupdate.desktop, Image=bash (running as root). Audit log: SYSCALL with auid showing the user who ran sudo. DeviceFileEvents with ActionType=FileCreated.

  3. Test 3XDG Autostart Entry via Echo (Inline Creation)

    Expected signal: Sysmon for Linux Event ID 1: Process Create for bash/echo with CommandLine containing autostart and .desktop. Sysmon Event ID 11: FileCreate for the .desktop file. DeviceProcessEvents with ProcessCommandLine containing the echo command.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections