[plug] network sniffer

John Summerfield summer at os2.ami.com.au
Wed Oct 13 19:45:56 WST 1999


> I'm after a network sniffer for Linux  that can be used to
> examine packet contents. I'll be using it to monitor HTTP headers. I've
> tried 'snoop' and 'tcpdump' but they display packet contents in HEX
> ('snoop'
> does a crappy HEX/ASCII combo) whereas I would like a purely ASCII view
> of
> the HTTP packet contents for my perusal. I'm after something which has
> nice
> display format for my purpose (ie. reading ASCII),

If you use squid, you can see the headers in /var/log/squid/access. You 
can grep to find the bits you want, then pass it through the little perl 
I'm offering.

-------------- next part --------------
#!/usr/bin/perl
print Scrub(<>);
sub Scrub
   {
      my @data = @_;
      my $Result = "";
      foreach $Datum (@data)
        {
         $Datum =~ tr/+/ /;
         $Datum =~ s/%(..)/pack("c",hex($1))/ge;
         $Datum =~ s/\r//g;
         $Result .= $Datum;
        }
      #$Posting = tr/+/ / ;
      return $Result;
   }

-------------- next part --------------
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.


More information about the plug mailing list