Ticket #29 (new defect)
Regenerating packets from their str() output adds Padding
| Reported by: | abo <abo@…> | Owned by: | pbi |
|---|---|---|---|
| Priority: | minor | Milestone: | scapy 2.2 |
| Component: | Scapy | Version: | |
| Keywords: | Padding regenerating | Cc: |
Description
Packets read in using rdpcap() can gain Padding when regenerated from their str() output;
>>> p.payload <IP version=4L ihl=5L tos=0x0 len=56 id=0 flags= frag=0L ttl=253 proto=ICMP chksum=0xdf56 src=172.26.130.243 dst=172.28.3.68 options='' |<ICMP type=time-exceeded code=0 chksum=0xc5ed id=0x0 seq=0x0 |<IPerror version=4L ihl=5L tos=0x0 len=40 id=51655 flags= frag=0L ttl=1 proto=TCP chksum=0xa247 src=172.28.3.68 dst=66.249.91.104 options='' |<TCPerror sport=2040 dport=www seq=621806010L |>>>> >>> IP(str(p.payload)) <IP version=4L ihl=5L tos=0x0 len=56 id=0 flags= frag=0L ttl=253 proto=ICMP chksum=0xdf56 src=172.26.130.243 dst=172.28.3.68 options='' |<ICMP type=time-exceeded code=0 chksum=0xc5ed id=0x0 seq=0x0 |<IPerror version=4L ihl=5L tos=0x0 len=40 id=51655 flags= frag=0L ttl=1 proto=TCP chksum=0xa247 src=172.28.3.68 dst=66.249.91.104 options='' |<TCPerror sport=2040 dport=www seq=621806010L |<Padding load='\x00\x00\x00\x00P\x02 \x00\x13\x0f\x00\x00' |>>>>> >>>
This apparently has something to do with the len field being out of sync with the payload lengths, such that when the packet is str()'ed you get a longer string than the original package. When this is regenerated, the extra bytes are seen as extra Padding. Note that this padding grows with each str() regenerate cycle.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.