First, sorry to the mods - I did not post the original post in the correct place (originally posted in the beginner forums).
Second, I've read every tutorial and guide I can find... makes me think that it's an RTFM python problem, in which case a direction to go would be very much appreciated.
And now, on to the show.
A normal HTTP conversation from wget is recorded by wireshark as follows:
My problem directly relates to the use of scapy's sr() function. I cannot seem to figure out how to reference individual packets within the list/tuple/whatever that gets returned by sr().Code:-->syn <--syn/ack -->ack -->(get request) <--200 OK --> ack <--(html data) -->(acks for html data) -->fin/ack <--ack <--fin/ack -->ack
Using sr1() I can read the first packet fine, but obviously I'm dropping responses due to only reading the one packet.
If I have the following:
The script crashes out and I'm informed that ack is not a member of tuple. How then, do I make the html variable not a tuple?Code:ans,unans=sr(ip/tcp/getrequest) html=ans[1] print str(html.ack)