R
Romain
Hi,
I wrote a little script to log the network traffic on a firewall and I
used the tcpdump command.
The script works very well when the command is a classic tcpdump one
like "tcpdump -vvni eth0 host 192.168.0.10 and port 21" but as soon as
I use this command "tcpdump -vvni eth0 tcp[13] == 18" to log only SYN
ACK packets it doesn't work.
Here is the beginning of my script:
#!/usr/bin/perl
$command = 'tcpdump -vvni eth0 tcp[13] == 18'
($pid = open(PIPE,"$command |")) or die "Error: $!\n";
(kill 0, $pid) or die "tcpdump failed\n";
while (defined($line = <PIPE>))
{
print $line;
}
It doesn't print anything although tcpdump catured packets.
if I set the $command to 'tcpdump -vvni eth0', it works fine.
I supposed that the problem comes from the [] that I use in the
command.
Could anyone help me about that?
Thanks.
I wrote a little script to log the network traffic on a firewall and I
used the tcpdump command.
The script works very well when the command is a classic tcpdump one
like "tcpdump -vvni eth0 host 192.168.0.10 and port 21" but as soon as
I use this command "tcpdump -vvni eth0 tcp[13] == 18" to log only SYN
ACK packets it doesn't work.
Here is the beginning of my script:
#!/usr/bin/perl
$command = 'tcpdump -vvni eth0 tcp[13] == 18'
($pid = open(PIPE,"$command |")) or die "Error: $!\n";
(kill 0, $pid) or die "tcpdump failed\n";
while (defined($line = <PIPE>))
{
print $line;
}
It doesn't print anything although tcpdump catured packets.
if I set the $command to 'tcpdump -vvni eth0', it works fine.
I supposed that the problem comes from the [] that I use in the
command.
Could anyone help me about that?
Thanks.