-
Notifications
You must be signed in to change notification settings - Fork 0
/
wcclean
49 lines (49 loc) · 1.58 KB
/
wcclean
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
#!/usr/bin/perl -w
#
# This shouldn't be used unless Curses::UI dies unexpectedly and
# Warcarrier cannot re-connect back to the current running CSV
# from Airodump-NG
#
use warnings;
use strict;
if($ARGV[0]){ ### Arguments ###
if($ARGV[0] =~ m/--?h(elp)?/){ # program flow here:
usage();
}elsif($ARGV[0] eq 'logs'){
logs();
}elsif($ARGV[0] eq 'sys'){
sys();
}elsif($ARGV[0] eq 'proc'){
proc();
}elsif($ARGV[0] eq 'all'){
sys();proc();logs();
}else{
usage();
}
}else{
usage();
}
sub logs{ # subroutine for logs
system("rm logs/txt/* 2>/dev/null"); # Catchme-NG, etc.
system("rm logs/html/* 2>/dev/null"); # HTML logs and Google Maps
system("rm logs/capfiles/* 2>/dev/null"); # Airodump PCAP (Can get rather large!)
system("rm logs/bluetooth/* 2>/dev/null"); # Ubertooth Site Record
}
sub sys{ # subroutine for system files
system("rm bt.* 2>/dev/null"); # bluetooth dump file from hcitool: Net::Bluetooth
system("rm gps.* 2>/dev/null"); # dump files from GPSD
system("rm wc.* 2>/dev/null"); # dunno i'm druonkl
system("rm ubt.out 2>/dev/null"); # Uberooth output formatted
system("rm ubt.raw 2>/dev/null"); # UBertooth output formatted by nice
}
sub proc{ # subroutine for runaway processes
system("killall airodump-ng 2>/dev/null");
my $killcmd = "ps aux | grep [s]pectool | awk '{print \$2}' | xargs kill 2>/dev/null";
system($killcmd);
}
sub usage{ # whoops
print "Usage: ./wcclean (proc|sys|logs|all)\n".
" all:\teverything.\n proc:\tstop runaway processes\n logs:\tdestroy log\n sys:\tdestroy system files\n\n";
exit;
}
print "[ WC ] Warcarrier clean-up completed.\n";