Lion Cipher Lab
Catch shell startup file changes (T1546.004), and test the cleanup before you trust it (Purple Persistence 4 of 5)
- SOC Analyst / Blue Team
- Intermediate
- ~55 min
- Free · no account required
Why it matters
A line added to a shell startup file runs every time that user starts a shell. It is persistence that needs no new process, account or schedule. It is also easy to get wrong when cleaning up, because the cleanup edits the file back by hand. The skill here is to treat your own cleanup as something to test, and to prove the original state is back.
What you'll learn
- backing up a file before a test so you can restore it exactly
- watching user and system shell startup files with write rules
- running the documented .bashrc and .profile atomics with their default harmless payload
- reading the project's cleanup critically and restoring from a backup instead
- proving a file is back to its original contents with a checksum
Steps in this lab
- Rules of this lab, and the technique
- Read the atomics, including their cleanup
- Back up the files and record their checksums
- Write the rules
- Run Atomic Tests 2 and 5, and find the events
- Restore from the backup and prove it with checksums
- Blind spots, and what to hand over
Open the full interactive lab →