Techniques de persistance Linux
Chaque emplacement d’un système Linux qui fait réexécuter du code : ce qui le lit et quand, où il se trouve, comment les intrus l’exploitent et comment vérifier un hôte. Chaque page renvoie à MITRE ATT&CK et à ce que signale l’outil Linux Persistence.
Par déclencheur
Au démarrage
- Kernel modulesEn anglaisHow attackers load rootkit kernel modules at boot and abuse modprobe install lines, what the configuration reveals, and how to check and clean a Linux host.T1547.006root
- rc.localEn anglaisHow /etc/rc.local runs commands as root at every boot through rc-local.service, how attackers plant payloads in it, and how to check and clean a host.T1037.004root
- systemd generatorsEn anglaisHow systemd generators run as root at every boot and daemon-reload, how attackers use them to create units that exist only in /run, and how to audit them.T1543.002root
- systemd servicesEn anglaisHow attackers persist with systemd services, sockets, path units, drop-in overrides and lingering user units on Linux, and how to find and remove them.T1543.002Utilisateurs et root
- SysV init scriptsEn anglaisHow attackers persist with /etc/init.d scripts and rc?.d start links on SysV and systemd hosts, and how to find, verify and remove a malicious init script.T1037.004root
Planifié
- At jobsEn anglaisHow attackers use at and atd for delayed or self-renewing jobs on Linux, what a spool file reveals about who queued it, and how to list and remove jobs.T1053.002Utilisateurs et root
- Cron jobsEn anglaisHow attackers persist with crontab, /etc/cron.d, run-parts folders and anacron on Linux, and how to find, verify and remove a malicious cron job.T1053.003Utilisateurs et root
- Logrotate scriptsEn anglaisHow attackers hide commands in logrotate postrotate, prerotate, firstaction and lastaction scripts that run daily as root, and how to find and remove them.root
- systemd timersEn anglaisHow attackers use systemd timers instead of cron for scheduled persistence on Linux, where timer units live, and how to list, verify and remove them.T1053.006Utilisateurs et root
À la connexion
- Local accountsEn anglaisHow attackers add UID 0 users, empty passwords, shells on service accounts and root-equivalent groups on Linux, and how to audit passwd, shadow and group.T1136.001T1078.003root
- MOTD scriptsEn anglaisHow Debian and Ubuntu run /etc/update-motd.d scripts as root at every login through pam_motd, how attackers abuse them, and how to check and clean a host.root
- XDG autostartEn anglaisHow .desktop files in /etc/xdg/autostart and ~/.config/autostart start programs at every desktop login, how attackers abuse them, and how to check a host.T1547.013Utilisateurs et root
À chaque nouveau shell
- History tamperingEn anglaisHow intruders stop or wipe shell history on Linux (.bash_history linked to /dev/null, HISTFILE unset), why it travels with persistence, and how to check.T1070.003Utilisateurs et root
- Shell startup filesEn anglaisHow .bashrc, .profile, /etc/profile.d and zsh files run code at every login or shell, how attackers plant aliases and payloads in them, and how to check.T1546.004Utilisateurs et root
À la connexion SSH
- SSH authorized keysEn anglaisHow attackers plant SSH keys, forced commands and ~/.ssh/rc scripts to keep access to Linux hosts, and how to find rogue authorized_keys entries.T1098.004Utilisateurs et root
- sshd configurationEn anglaisHow attackers change sshd_config, its drop-ins and Match blocks to keep SSH access to Linux hosts, and how to audit the effective OpenSSH server settings.T1098.004root
À l’authentification
Privilège
Sur événement
Au changement de réseau
À l’installation de paquets
À chaque lancement de programme
Aide-mémoire
Une ligne par technique : quand elle s’exécute, qui peut la mettre en place, les principaux emplacements et la correspondance ATT&CK.
| Technique | Déclenchement | Mis en place par | Emplacements principaux | ATT&CK |
|---|---|---|---|---|
| At jobsEn anglais | Planifié | Utilisateurs et root | /var/spool/cron/atjobs/* · /var/spool/at/* · /etc/at.allow · /etc/at.deny | T1053.002 |
| Cron jobsEn anglais | Planifié | Utilisateurs et root | /etc/crontab · /etc/cron.d/* · /etc/cron.hourly/* · /etc/cron.daily/* | T1053.003 |
| History tamperingEn anglais | À chaque nouveau shell | Utilisateurs et root | ~/.bash_history · ~/.zsh_history · /root/.bash_history · ~/.bashrc | T1070.003 |
| Kernel modulesEn anglais | Au démarrage | root | /etc/modules · /etc/modules-load.d/*.conf · /etc/modprobe.d/*.conf · /usr/lib/modules-load.d/*.conf | T1547.006 |
| LD_PRELOAD / ld.so.preloadEn anglais | À chaque lancement de programme | Utilisateurs et root | /etc/ld.so.preload · /etc/ld.so.conf · /etc/ld.so.conf.d/*.conf · /etc/environment | T1574.006 |
| Local accountsEn anglais | À la connexion | root | /etc/passwd · /etc/shadow · /etc/group · /etc/gshadow | T1136.001, T1078.003 |
| Logrotate scriptsEn anglais | Planifié | root | /etc/logrotate.conf · /etc/logrotate.d/* | — |
| MOTD scriptsEn anglais | À la connexion | root | /etc/update-motd.d/* · /etc/pam.d/sshd · /etc/pam.d/login · /run/motd.dynamic | — |
| Network hooksEn anglais | Au changement de réseau | root | /etc/NetworkManager/dispatcher.d/* · /etc/network/if-up.d/* · /etc/network/if-pre-up.d/* · /etc/ppp/ip-up.d/* | — |
| Package manager hooksEn anglais | À l’installation de paquets | root | /etc/apt/apt.conf.d/* · /etc/dpkg/dpkg.cfg.d/* · /etc/dnf/plugins/*.conf · /etc/yum/pluginconf.d/*.conf | T1546.016 |
| PAM backdoorsEn anglais | À l’authentification | root | /etc/pam.d/* · /etc/pam.conf · /usr/share/pam-configs/* · /usr/lib/x86_64-linux-gnu/security/*.so | T1556.003 |
| rc.localEn anglais | Au démarrage | root | /etc/rc.local · /etc/rc.d/rc.local · /usr/lib/systemd/system/rc-local.service | T1037.004 |
| Shell startup filesEn anglais | À chaque nouveau shell | Utilisateurs et root | /etc/profile · /etc/profile.d/*.sh · /etc/bash.bashrc · /etc/bashrc | T1546.004 |
| SSH authorized keysEn anglais | À la connexion SSH | Utilisateurs et root | ~/.ssh/authorized_keys · ~/.ssh/authorized_keys2 · /root/.ssh/authorized_keys · ~/.ssh/rc | T1098.004 |
| sshd configurationEn anglais | À la connexion SSH | root | /etc/ssh/sshd_config · /etc/ssh/sshd_config.d/*.conf · /etc/ssh/sshrc · /etc/default/ssh | T1098.004 |
| Sudoers rulesEn anglais | Privilège | root | /etc/sudoers · /etc/sudoers.d/* · /etc/sudo.conf | T1548.003 |
| systemd generatorsEn anglais | Au démarrage | root | /etc/systemd/system-generators/* · /usr/local/lib/systemd/system-generators/* · /usr/lib/systemd/system-generators/* · /run/systemd/system-generators/* | T1543.002 |
| systemd servicesEn anglais | Au démarrage | Utilisateurs et root | /etc/systemd/system/* · /etc/systemd/system/<unit>.d/*.conf · /usr/lib/systemd/system/* · /usr/local/lib/systemd/system/* | T1543.002 |
| systemd timersEn anglais | Planifié | Utilisateurs et root | /etc/systemd/system/*.timer · /etc/systemd/system/timers.target.wants/* · /usr/lib/systemd/system/*.timer · ~/.config/systemd/user/*.timer | T1053.006 |
| SysV init scriptsEn anglais | Au démarrage | root | /etc/init.d/* · /etc/rc[0-6S].d/* · /etc/rc.d/init.d/* · /etc/rc.d/rc[0-6].d/* | T1037.004 |
| udev rulesEn anglais | Sur événement | root | /etc/udev/rules.d/*.rules · /run/udev/rules.d/*.rules · /usr/lib/udev/rules.d/*.rules · /lib/udev/rules.d/*.rules | T1546.017 |
| XDG autostartEn anglais | À la connexion | Utilisateurs et root | /etc/xdg/autostart/*.desktop · ~/.config/autostart/*.desktop | T1547.013 |
Couverture MITRE ATT&CK
Les techniques ATT&CK couvertes par ces pages et par l’outil. Certains mécanismes n’ont pas de sous-technique propre et sont classés sous la technique parente la plus proche.