4 #Released by James C. Foster & Mark Burnett at BlackHat Windows 2004 in Seattle
5 #January 2004
6
7
use Getopt::Std;
8
9
getopts('d:t:rhs:l:') || usage();
10
11
$logfile = $opt_l;
12
13
##########
14
15
if ($opt_h == 1)
16 {
17 usage();
18 }
19 ##########
20
21
if ($opt_t ne "" && $opt_s eq "")
22 {
23 open (FILE, "$logfile");
24
25
while (<FILE>)
26 {
27 $ranip=randomip();
28 s/$opt_t/$ranip/;
29 push(@templog,$_);
30 next;
31 }
32
33
close FILE;
34 open (FILE2, ">$logfile") || die("couldnt open");
35 print FILE2"@templog";
36 close FILE2;
37 }
38 ##########
39
40
if ($opt_s ne "")
41 {
42 open (FILE, "$logfile");
43
44
while (<FILE>)
45 {
46 s/$opt_t/$opt_s/;
47 push(@templog,$_);
48 next;
49 }
50
51
close FILE;
52 open (FILE2, ">$logfile") || die("couldnt open");
53 print FILE2"@templog";
54 close ...