Y
yezi
Dear all:
My problem is I ask the eth0 to listen all the packet source from
www.cnn.com , then collect all the packets to some file cnn.dmp. SO I
write the code with perl.
#!/usr/bin/perl
use warnings;
use strict;
my $filename;
my $cmdline;
my $cmdline1;
$filename="/home/binye/test_perl/testdownload.txt";
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
while( <FILE> ) {
my $cmdline1="tcpdump -i eth0 src host $_ -w $_.dmp";
system($cmdline1);
print "Processing wget.";
my $cmdline="wget http://$_ -q";
system($cmdline);
print "done ...w $_..";
}
close FILE;
The code can execute the first tcpdump, then just stay here. I suppose
after tcpdump, the code should simultaneously execute the wget, so that
the file can tcpdump to the cnn.dmp. I do not know how to solve the
sequence problem. Any help is appreciated.
Thanks all
My problem is I ask the eth0 to listen all the packet source from
www.cnn.com , then collect all the packets to some file cnn.dmp. SO I
write the code with perl.
#!/usr/bin/perl
use warnings;
use strict;
my $filename;
my $cmdline;
my $cmdline1;
$filename="/home/binye/test_perl/testdownload.txt";
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
while( <FILE> ) {
my $cmdline1="tcpdump -i eth0 src host $_ -w $_.dmp";
system($cmdline1);
print "Processing wget.";
my $cmdline="wget http://$_ -q";
system($cmdline);
print "done ...w $_..";
}
close FILE;
The code can execute the first tcpdump, then just stay here. I suppose
after tcpdump, the code should simultaneously execute the wget, so that
the file can tcpdump to the cnn.dmp. I do not know how to solve the
sequence problem. Any help is appreciated.
Thanks all