|
Revision 998, 1.2 kB
(checked in by kindlund, 1 year ago)
|
Merged trunk into dynamic_updates branch.
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
open(BLA, "/tmp/realtime-changes.txt") or die "Can't open the file\n"; |
|---|
| 4 |
|
|---|
| 5 |
@dump = <BLA>; |
|---|
| 6 |
close BLA; |
|---|
| 7 |
%file_hash; |
|---|
| 8 |
%reg_hash; |
|---|
| 9 |
%proc_hash; |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
foreach $line (@dump){ |
|---|
| 13 |
|
|---|
| 14 |
$line =~ s/"\r\n//g; |
|---|
| 15 |
$line =~ s/^\"(.*)/$1/; |
|---|
| 16 |
|
|---|
| 17 |
$line =~ s/\\/\\\\/g; |
|---|
| 18 |
$line =~ s/\./\\\./g; |
|---|
| 19 |
|
|---|
| 20 |
@toks = split("\",\"", $line, 8); |
|---|
| 21 |
if($toks[1] eq "file"){ |
|---|
| 22 |
$file_hash{"+\t$toks[2]\t$toks[4]\t$toks[5]"} = 1; |
|---|
| 23 |
|
|---|
| 24 |
} |
|---|
| 25 |
elsif($toks[1] eq "registry"){ |
|---|
| 26 |
$reg_hash{"+\t$toks[2]\t$toks[4]\t$toks[5]"} = 1; |
|---|
| 27 |
} |
|---|
| 28 |
elsif($toks[1] eq "process"){ |
|---|
| 29 |
$toks[6] =~ s/\\\./\./g; |
|---|
| 30 |
@junk = split(/\\/, $toks[6]); |
|---|
| 31 |
$last = pop @junk; |
|---|
| 32 |
$proc_hash{"+\t$last\t.*\t$toks[6]"} = 1; |
|---|
| 33 |
} |
|---|
| 34 |
|
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
open(FILE, ">file_ex.txt"); |
|---|
| 38 |
open(REG, ">reg_ex.txt"); |
|---|
| 39 |
open(PROC, ">proc_ex.txt"); |
|---|
| 40 |
|
|---|
| 41 |
print FILE " |
|---|
| 42 |
print PROC "#### HONEYCLIENT AUTO EXCLUDE SCRIPT\r\n"; |
|---|
| 43 |
print REG "#### HONEYCLIENT AUTO EXCLUDE SCRIPT\r\n"; |
|---|
| 44 |
|
|---|
| 45 |
foreach $key (keys %file_hash){ |
|---|
| 46 |
print "$key\n"; |
|---|
| 47 |
print FILE "$key\r\n"; |
|---|
| 48 |
} |
|---|
| 49 |
foreach $key (keys %reg_hash){ |
|---|
| 50 |
print "$key\n"; |
|---|
| 51 |
print REG "$key\r\n"; |
|---|
| 52 |
} |
|---|
| 53 |
foreach $key (keys %proc_hash){ |
|---|
| 54 |
print "$key\n"; |
|---|
| 55 |
print PROC "$key\r\n"; |
|---|
| 56 |
} |
|---|
| 57 |
close FILE; |
|---|
| 58 |
close REG; |
|---|
| 59 |
close PROC; |
|---|
| 60 |
|
|---|