How To Create a Web Request Sniffer Using tcpdump and Perl
erics, Posted November 3rd, 2011 at 10:42:44am
YMMV…
1 2 3 4 5 6 7 8 9 10 |
#!/usr/bin/perl use strict; $| = 1; our $LIMIT = shift || 5000; open (STDIN,"/usr/sbin/tcpdump -Atpn dst port 80 |"); while (<>) { last unless $LIMIT--; next unless /get|host|post|http|xml/i; print; } |
Additional Reading
http://chaosreader.sourceforge.net/
http://www.id-snippet.com/3008/dump-http-packet-using-tcpdump-and-perl/
http://stein.cshl.org/~lstein/talks/WWW6/sniffer/
http://www.perlmonks.org/index.pl?node_id=254612
Leave Your Comment
All fields marked with "*" are required.