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]

Error in libnet_pblock_coalesce()

Subject: Error in libnet_pblock_coalesce()
Date: Tue, 25 Jan 2005 13:08:42 +0100 (CET)
Hi,
i've written a routine to send TCP SYN packets.
When this routine is executed,the first packet is sent
and the it terminates with the following error
message:

libnet_pblock_coalesce(): packet assembly cannot find
an IPv4 header.

The routine's code is the following:

void send_tcp_pkt(u_int32_t daddr) {
  seq = rand();
  tcp =
libnet_build_tcp(lport,dport,seq,ack,TH_SYN,32767,0,0,LIBNET_TCP_H,NULL,0,l,tcp);
  if (tcp == -1){
    fprintf(stderr,"Can't build tcp header:
%s\n",libnet_geterror(l));
    exit(1);
  }
  ip =
libnet_build_ipv4(LIBNET_IPV4_H+LIBNET_TCP_H,0,id,0,64,IPPROTO_TCP,0,laddr,daddr,NULL,0,l,ip);
  if (ip == -1) {
    fprintf(stderr,"Can't build ip header:
%s\n",libnet_geterror(l));
    exit(1);
  }
  if (libnet_write(l) == -1){
      fprintf(stderr,"libnet_write():
%s\n",libnet_geterror(l));
      exit(1);
  }
}

What's wrong with this code?

Thanks.


                
___________________________________ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica? Scaricalo ora! 
http://it.messenger.yahoo.it

<Prev in Thread] Current Thread [Next in Thread>
  • Error in libnet_pblock_coalesce(), marco alamanni <=