RE: ICMPv6 Checksum Calculation Error
2012-01-04 23:42:39 GMT
Set the checksum to None and it will auto change it to the correct one for you, I had this problem before
For example in one of my programs I have:
packets_in[i].payload.payload.cksum=None
In this case I had a “packet list” of packets so packets_in[0] is packet 1, its payload is IP, that payload is ICMP, and then I change the cksum on the ICMP or whatever top end header that has a cksum
Make sense?
-S
From: Vishal Malhan [mailto:malhanvishal <at> gmail.com]
Sent: Wednesday, January 04, 2012 6:30 AM
To: scapy.ml <at> secdev.org
Subject: Re: [scapy.ml] ICMPv6 Checksum Calculation Error
Yeah, sendp sends at layer2, thats why we insert the Ether header as well...
If i give fill the correct checksum in cksum variable in ICMPv6EchoRequest,
the echo reply does come and things work... The issue is with the checksum
that is autofilled...
--Vishal
On Wed, Jan 4, 2012 at 3:32 PM, César A. Bernardini <mesarpe <at> gmail.com> wrote:
I can't resolve your problem, but I found that you are doing something
wrongly about the sendp function. The sendp function works at layer 2
and send functions is the one you are looking for (layer 3).
Hope it helps!
2012/1/4 Vishal Malhan <malhanvishal <at> gmail.com>:
> Hi,
>
> I am trying to send a ICMPv6 fragmented packet using scapy. The packet gets
> sent but i don't see the echo reply coming.
> I checked the generated packet in wireshark and saw the checksum generated
> was wrong. Supplying a correct checksum saw the reply coming.
> Is this a known issue in scapy?
>
> I am using scapy version 2.2.0 on Centos 5.6 x68_64 platform.
>
> The packets that i constructed is as follows:
>
> pkt1=Ether()/IPv6(src="2001:5b0:2:0:f27d:68ff:feb8:c0fb",
> dst="2001:5b0:2:0:21b:78ff:fe81:3c69",
> plen=1456)/IPv6ExtHdrFragment(m=1,id=25782,offset=0)/ICMPv6EchoRequest(data='a'*1440)
> pkt2=Ether()/IPv6(src="2001:5b0:2:0:f27d:68ff:feb8:c0fb",
> dst="2001:5b0:2:0:21b:78ff:fe81:3c69",
> plen=616)/IPv6ExtHdrFragment(m=0,id=25782,offset=181)/'a'*608
> sendp(pkt1)
> sendp(pkt2)
>
> Note that I had to supply Ether header as well. If I don't supply the Ether
> header, the packet doesn't reach the destination host.
> Also I tried using the in6_chksum() scapy fn to calculate the checksum
> directly to supply but the checksum generated was still not matching.
>
> I tried
> csum=in6_chksum(58, pkt1, 'a'*1440)
> csum=in6_chksum(58, pkt1, 'a'*2048)
>
> pkt=IPv6(src="2001:5b0:2:0:f27d:68ff:feb8:c0fb",
> dst="2001:5b0:2:0:21b:78ff:fe81:3c69",
> plen=2056)/ICMPv6EchoRequest(data='a'*2048)
> csum=in6_chksum(58,pkt,'a'*2048)
>
> None of above solved the issue.
>
> Pls advice.
>
> Regards,
> Vishal
---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
RSS Feed