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: libnet_write_raw_ipv4() Message too long

Subject: RE: libnet_write_raw_ipv4() Message too long
Date: Fri, 03 Sep 2004 12:33:07 +0000
Hello,

use a tag for your builder functions, this way your pblocks will be altered instead of creating each time a new pblock.
pseudo code:


ptag_data = 0;
ptag_tcp_or_udp_or_icmp= 0;
ptag_ip = 0;

for()
{
  ptag_data = libnet_build_data (...,...,..., ptag_data);

ptag_tcp_or_udp_or_icmp = libnet_build_tcp_or_udp_or_icmp (..,...ptag_tcp_or_udp_or_icmp );

 ptag_ip = libnet_build_ip (...., ..., ptag_ip);

 libnet_wrilt();
}

like this the first time you enter the loop you will create a new pblock for each build_xxx() because the tags passed are 0, these fns will return you a tag, the next time you call the functions the tags will have a value. so libnet will search for the blocks with the corresponding tags and modify the contents of the block instaed of creating a new one.

You could also use libnet_clear_packet() after you send the packet each time, which will delete all the pblocks of the libnet context. if you use this method always pass a zero in the tag field of the build_xx fns. after you libnet_write() call libnet_clear_packet().

also check the samples, I think if you read through the codes you can easily do what you want.

Regards, Mustaffa Abu Sedira


From: Ben L <bernd.leitner@gmx.at>
To: libnet@securityfocus.com
Subject: libnet_write_raw_ipv4() Message too long
Date: 2 Sep 2004 13:28:10 -0000



Hello,

i have a problem with my libnet application. I have written a small programm to test my firewall and a packetlogger. My code simply creates some ip packets with valid ip addresses in a loop.
Those packets are transmitted via tcp.


Everything works fine for about 70 packets, then i get the (Message too long) error msg.

The problem is that my code always adds the data for the new packet to the current libnet context. I need a way to get rid of the old data after i have sended a packet in a loop.

pseudo code:

while (ip addresses)

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


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