T1546.005 Trap
PersistencePrivilege Escalationon attack.mitre.org
ATT&CK Enterprise 20.0 · 20.1 released, update in review
How MITRE detects it
DET0369 Detection Strategy for Event Triggered Execution via Trap (T1546.005)
AN1038 Linux
Correlate file modifications in shell startup scripts (e.g., .bashrc, .profile) with embedded `trap` commands and observe if those changes are followed by the unexpected execution of child processes when terminal signals (e.g., SIGINT) are triggered. Use contextual linking with user session activity to detect privilege misuse.
| MITRE log source | In Microsoft Sentinel |
|---|---|
auditd:SYSCALLexecve | Not mapped to Sentinel yet. |
auditd:SYSCALLModification of user shell profile or trap registration via echo/redirection (e.g., echo "trap 'malicious_cmd' INT" >> ~/.bashrc) | Not mapped to Sentinel yet. |
auditd:SYSCALLopen | Not mapped to Sentinel yet. |
AN1039 macOS
Detect unauthorized `trap` command registrations in shell startup files (e.g., .zprofile, .bash_profile, .zshrc) followed by execution chains during user terminal interaction. Use Unified Logs and EDR telemetry to correlate shell command parsing and process tree anomalies.
| MITRE log source | In Microsoft Sentinel |
|---|---|
macos:unifiedlogCommand line containing `trap` or `echo 'trap` written to login shell files | Not mapped to Sentinel yet. |
macos:unifiedlogFile write or append to .zshrc, .bash_profile, .zprofile, etc. | Not mapped to Sentinel yet. |
Content Hub rules tagged with it (0)
No Content Hub rule is tagged with this technique.
In Sigma rules
Mitigations
- None listed by MITRE.
MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.