Técnicas de persistencia en Linux
Cada lugar de un sistema Linux que hace que se vuelva a ejecutar código: qué lo lee y cuándo, dónde reside, cómo lo aprovechan los intrusos y cómo revisar un equipo. Cada página se corresponde con MITRE ATT&CK y con lo que marca la herramienta Linux Persistence.
Por disparador
Al arrancar
- Kernel modulesEn inglésHow 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 inglésHow /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 inglésHow 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 inglésHow 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.002Usuarios y root
- SysV init scriptsEn inglésHow 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
Programado
- At jobsEn inglésHow 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.002Usuarios y root
- Cron jobsEn inglésHow 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.003Usuarios y root
- Logrotate scriptsEn inglésHow 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 inglésHow 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.006Usuarios y root
Al iniciar sesión
- Local accountsEn inglésHow 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 inglésHow 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 inglésHow .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.013Usuarios y root
En cada shell nuevo
- History tamperingEn inglésHow 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.003Usuarios y root
- Shell startup filesEn inglésHow .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.004Usuarios y root
Al iniciar sesión por SSH
- SSH authorized keysEn inglésHow 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.004Usuarios y root
- sshd configurationEn inglésHow 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
Al autenticarse
Privilegio
Ante un evento
Al cambiar la red
Al instalar paquetes
En cada inicio de programa
Referencia rápida
Una línea por técnica: cuándo se ejecuta, quién puede configurarla, las ubicaciones principales y la correspondencia con ATT&CK.
| Técnica | Disparador | Configurado por | Ubicaciones principales | ATT&CK |
|---|---|---|---|---|
| At jobsEn inglés | Programado | Usuarios y root | /var/spool/cron/atjobs/* · /var/spool/at/* · /etc/at.allow · /etc/at.deny | T1053.002 |
| Cron jobsEn inglés | Programado | Usuarios y root | /etc/crontab · /etc/cron.d/* · /etc/cron.hourly/* · /etc/cron.daily/* | T1053.003 |
| History tamperingEn inglés | En cada shell nuevo | Usuarios y root | ~/.bash_history · ~/.zsh_history · /root/.bash_history · ~/.bashrc | T1070.003 |
| Kernel modulesEn inglés | Al arrancar | 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 inglés | En cada inicio de programa | Usuarios y root | /etc/ld.so.preload · /etc/ld.so.conf · /etc/ld.so.conf.d/*.conf · /etc/environment | T1574.006 |
| Local accountsEn inglés | Al iniciar sesión | root | /etc/passwd · /etc/shadow · /etc/group · /etc/gshadow | T1136.001, T1078.003 |
| Logrotate scriptsEn inglés | Programado | root | /etc/logrotate.conf · /etc/logrotate.d/* | — |
| MOTD scriptsEn inglés | Al iniciar sesión | root | /etc/update-motd.d/* · /etc/pam.d/sshd · /etc/pam.d/login · /run/motd.dynamic | — |
| Network hooksEn inglés | Al cambiar la red | root | /etc/NetworkManager/dispatcher.d/* · /etc/network/if-up.d/* · /etc/network/if-pre-up.d/* · /etc/ppp/ip-up.d/* | — |
| Package manager hooksEn inglés | Al instalar paquetes | root | /etc/apt/apt.conf.d/* · /etc/dpkg/dpkg.cfg.d/* · /etc/dnf/plugins/*.conf · /etc/yum/pluginconf.d/*.conf | T1546.016 |
| PAM backdoorsEn inglés | Al autenticarse | root | /etc/pam.d/* · /etc/pam.conf · /usr/share/pam-configs/* · /usr/lib/x86_64-linux-gnu/security/*.so | T1556.003 |
| rc.localEn inglés | Al arrancar | root | /etc/rc.local · /etc/rc.d/rc.local · /usr/lib/systemd/system/rc-local.service | T1037.004 |
| Shell startup filesEn inglés | En cada shell nuevo | Usuarios y root | /etc/profile · /etc/profile.d/*.sh · /etc/bash.bashrc · /etc/bashrc | T1546.004 |
| SSH authorized keysEn inglés | Al iniciar sesión por SSH | Usuarios y root | ~/.ssh/authorized_keys · ~/.ssh/authorized_keys2 · /root/.ssh/authorized_keys · ~/.ssh/rc | T1098.004 |
| sshd configurationEn inglés | Al iniciar sesión por SSH | root | /etc/ssh/sshd_config · /etc/ssh/sshd_config.d/*.conf · /etc/ssh/sshrc · /etc/default/ssh | T1098.004 |
| Sudoers rulesEn inglés | Privilegio | root | /etc/sudoers · /etc/sudoers.d/* · /etc/sudo.conf | T1548.003 |
| systemd generatorsEn inglés | Al arrancar | root | /etc/systemd/system-generators/* · /usr/local/lib/systemd/system-generators/* · /usr/lib/systemd/system-generators/* · /run/systemd/system-generators/* | T1543.002 |
| systemd servicesEn inglés | Al arrancar | Usuarios y root | /etc/systemd/system/* · /etc/systemd/system/<unit>.d/*.conf · /usr/lib/systemd/system/* · /usr/local/lib/systemd/system/* | T1543.002 |
| systemd timersEn inglés | Programado | Usuarios y 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 inglés | Al arrancar | 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 inglés | Ante un evento | 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 inglés | Al iniciar sesión | Usuarios y root | /etc/xdg/autostart/*.desktop · ~/.config/autostart/*.desktop | T1547.013 |
Cobertura de MITRE ATT&CK
Las técnicas de ATT&CK que cubren estas páginas y la herramienta. Algunos mecanismos no tienen subtécnica propia y figuran bajo la técnica principal más cercana.