Theory · 8 min · Linux monitoring
Linux persistence: cron, systemd, keys
Check the places attackers use to come back on a Linux host.
Cron runs commands on a schedule: per-user crontabs (crontab -l), /etc/crontab and /etc/cron.d. A line that downloads and pipes into a shell every few minutes is a classic.
systemd services and timers can start anything at boot or on a schedule. New unit files under /etc/systemd/system or ~/.config/systemd/user, especially with an odd ExecStart path in /tmp or /dev/shm, deserve a look.
An attacker’s public key added to ~/.ssh/authorized_keys gives them a quiet way back in, even after the password changes.
Shell start-up files (.bashrc, .profile) run on every login and are another easy hiding place.
T1053.003T1543.002T1098.004T1496
Your turn: match observations. Match each finding to its ATT&CK technique.
Do the interactive check Free, in the browser.
Sources
- ATT&CK T1053.003: Scheduled Task/Job: Cron MITRE ATT&CK v20
- ATT&CK T1543.002: Create or Modify System Process: Systemd Service MITRE ATT&CK v20
- systemd.timer manual freedesktop.org
- ATT&CK T1496: Resource Hijacking MITRE ATT&CK v20