Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Libnet
[Top] [All Lists]

Re: IP cheksum and libnet_pblock_coalesce

Subject: Re: IP cheksum and libnet_pblock_coalesce
Date: Fri, 24 Sep 2004 19:30:42 +0200
Hi,

On Thu, Sep 23, 2004 at 05:00:04PM -0700, Kenichi MORI wrote:


Hi jarppe

Hello everybody,

Should libnet_pblock_coalesce() set the IP checksum correctly? I'm
using libnet 1.1.2.1, compiled with GCC 3.2.2 20030222 on Linux.

When I create packet using libnet_build_[udp|tcp]() +
libnet_build_ip(), then get the packet using
libnet_pblock_coalesce() and then call libnet_ip_check() over the
returned buffer, I get non-zero reply, indicating wrong IP
checksum.

Interestingly enough, if I create the packet with
libnet_build_icmpv4_echo() + libnet_build_ip(), then
libnet_ip_check() returns zero (checksum ok).

Am I doing something wrong, or is there a bug?

-jarppe

I had something similar situation. I'm also using libnet 1.1.2.1
with GCC (Redhat9).

I also found some wrong checksum packets created by libnet.  So, I
replace the function libnet_in_checksum() (libnet_checksum.c) with
the same name function of libnet-1.0.2a, there is no wrong packet.

-Kenichi


I dont understand why you call libnet_ip_check() :
u_int16_t
libnet_ip_check(u_int16_t *addr, int len)
{
    int sum;

    sum = libnet_in_cksum(addr, len);
    return (LIBNET_CKSUM_CARRY(sum));
}

When you call libnet_pblock_coalesce() checksums are computed, so you
dont have to force any re-computation.

        Fred
            

<Prev in Thread] Current Thread [Next in Thread>