c - need help compiling something! (: -


i'm helping developers of im test security , issues, , wanted example of tcp reset vulnerability reported on server. i'm having issues compiling it, can help? error log: http://pastie.org/4212921

c file: http://www.exploit-db.com/download/291

it's idea start first reported error.

in cases, first reported error is:

reset-tcp.c:51: error: ‘u_char’ undeclared (first use in function) 

u_char not standard c type; it's typedef unsigned char.

your source file has following #include directives:

#include <libnet.h> #include <stdio.h> 

<stdio.h> can't define u_char, must defined in <libnet.h> -- in whatever version of <libnet.h> source file depends on.

that's non-standard header (it's not installed on system), best guess you're using different version of libnet 1 reset-tcp.c designed work with.

i know doesn't solve problem, should give starting point.

edit :

i installed libnet1, libnet1-dev, , libnet1-doc packages on ubuntu 12.04 system (version 1.1.4-2.1 of libnet1). source file compiles (after joining lines 74 , 75) warnings. type u_char defined in /usr/include/i386-linux-gnu/sys/types.h, indirectly included libnet.h.

i warnings:

291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 3 has type ‘u_char *’ [-wformat] 291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 4 has type ‘u_char *’ [-wformat] 291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 5 has type ‘u_char *’ [-wformat] 291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 6 has type ‘u_char *’ [-wformat] 291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 7 has type ‘u_char *’ [-wformat] 291.c:95:1: warning: format ‘%x’ expects argument of type ‘unsigned int *’, argument 8 has type ‘u_char *’ [-wformat] 291.c:116:1: warning: format ‘%i’ expects argument of type ‘int’, argument 2 has type ‘long unsigned int’ [-wformat] 

which should pay attention to; code tries store int values in u_char (unsigned char) objects.

suggestions :

  1. tell operating system , version of libnet you're using; may able offer better advice if have information.

  2. let know source code came from, , see if can find out version of libnet it's supposed work with.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -