mark
2008-01-25 14:59:51 UTC
Can anyone help me understand the TCP reassembly process and how I can apply it to a script using scapy? All the articles I have read on the subject rely on the More Fragments bit set to 1 but I have an entire capture file that is full of "parts of a reassembled PDU" that do not have that bit set.
I am attaching a small capture file with a gif image in it that was downloaded (to practice with - hopefully your filters wont delete this file). I know that I need to pay attention to the sequence numbers and all that but how do I know when a packet is fragmented and when have I received all the packets needed to reassemble the payload?
So the script will do something like this:
When I see a fragmented packet:
grab the appropriate information to know what to expect in the next packet
when I have all the packets:
reassemble the payload
if the payload is a gif image:
print "found a gif image"
wrpcap("gif.gif",reassembled_gif_image_from_packet_data)
I would very much appreciate any help you can provide.
Thanks in advance!
-Mark
---------------------------------
Never miss a thing. Make Yahoo your homepage.
I am attaching a small capture file with a gif image in it that was downloaded (to practice with - hopefully your filters wont delete this file). I know that I need to pay attention to the sequence numbers and all that but how do I know when a packet is fragmented and when have I received all the packets needed to reassemble the payload?
So the script will do something like this:
When I see a fragmented packet:
grab the appropriate information to know what to expect in the next packet
when I have all the packets:
reassemble the payload
if the payload is a gif image:
print "found a gif image"
wrpcap("gif.gif",reassembled_gif_image_from_packet_data)
I would very much appreciate any help you can provide.
Thanks in advance!
-Mark
---------------------------------
Never miss a thing. Make Yahoo your homepage.