in reply to recreate dsniff in perl
Unless you find a module that does that work for you, you need to accumulate packets and associate them with HTTP requests yourself.
In the simple case, you can stop accumulating data from a particular connection once you successfully match a GET header, and then clear it from the temporary store. This is not true for HTTP/1.1 connections though, since they may have several requests in them.
That said, a very quick'n'dirty and unreliable way that may work some of the time is to match the payload of each packet with something that looks like a GET request:
print "Requested: $1\n" if $payload =~ /GET (\S+)/;
Here too there is place for added robustness; many things can look like a URI and you only want to match the ones from an actual header.
Oh: and if you know which end of the connection is the web client, only look for GETs in packets sent from that end :)
|
|---|