nashr has asked for the wisdom of the Perl Monks concerning the following question:
This prints ALL the data going via HTTP. How would/should I go about parsing out JUST the GET string with the full URL information? Your help is greatly appreciated.#!/usr/bin/perl -w use strict; use Net::PcapUtils; use NetPacket::Ethernet qw(:strip); use NetPacket::IP qw(:strip); use NetPacket::TCP; sub process_pkt { my($arg, $hdr, $pkt) = @_; my $tcp_obj = NetPacket::TCP->decode(ip_strip(eth_strip($pkt))); if (($tcp_obj->{src_port} == 80) or ($tcp_obj->{dest_port} == 80)) + { print ($tcp_obj->{data}); } } Net::PcapUtils::loop(\&process_pkt, FILTER => 'tcp');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: recreate dsniff in perl
by gaal (Parson) on Jan 21, 2005 at 17:44 UTC | |
|
Re: recreate dsniff in perl
by traveler (Parson) on Jan 21, 2005 at 21:57 UTC | |
by nashr (Novice) on Jan 23, 2005 at 02:01 UTC |