Safeguard
Application Security•

Detecting and Mitigating Systemd Timer Abuse (T1053.006)

Systemd timers are a cron alternative on Linux that can also serve as persistence. Learn what MITRE says to log and which permissions to lock down.

Safeguard Security Team
2 min read

Systemd timers (T1053.006) are a Linux persistence and execution option that MITRE files under Scheduled Task/Job. The tactics are Execution, Persistence and Privilege Escalation, and the platform is Linux.

A timer is a unit file with a .timer extension that controls a service. It can fire on a calendar event or after a time span relative to a starting point. MITRE describes timers as an alternative to cron.

How attackers use it

Each .timer file needs a matching .service file with the same name, so example.timer pairs with example.service. Privileged timers live in /etc/systemd/system/ and /usr/lib/systemd/system. User level timers live in ~/.config/systemd/user/.

That split gives an adversary two options. A timer in a privileged path can hold root level persistence. A timer in the user path gives user level persistence without needing root. MITRE also notes that timers can be activated remotely with systemctl, which operates over SSH.

MITRE's own examples include a service registered for persistence on Kubernetes nodes and a user level service file under the home directory, so both paths are used in practice.

How to detect it

MITRE's analytic correlates two things: creation or modification of .timer and .service units in system directories, and the execution of abnormal child processes launched by systemd (PID 1), especially as root. A new unit file followed by something unfamiliar being started by systemd is the pattern.

How to reduce the risk

  1. Limit access to the root account and prevent users from creating or modifying timer unit files.
  2. Restrict read and write access to .timer files to the few privileged users who need to manage system services.
  3. Limit use of systemctl and systemd-run to users who have a legitimate need.

Check your own environment

Read-only commands on Linux:

  • systemctl list-timers --all shows every timer and what it triggers.
  • ls -la /etc/systemd/system/ /usr/lib/systemd/system | grep timer lists privileged timer files.
  • ls -la ~/.config/systemd/user/ shows user level units for the current account.

Anything you cannot tie to a package or a known owner deserves a look.

Quick check

Why does a user level timer matter even without root?

It lives under the user's home directory and still gives persistence at that user's privilege level.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.