我正在帮助IM的开发人员测试他们的安全性和问题,他们想要一个服务器上报告的tcp重置漏洞的例子。我在编译它时遇到问题,有人能帮忙吗?错误日志:http://pastie.org/4212921
C文件:http://www.exploit-db.com/download/291
从第一个报告的错误开始几乎总是一个好主意。
在您的情况下,第一个报告的错误是:
reset-tcp.c:51: error: ‘u_char’ undeclared (first use in this function)
CCD_ 1不是标准的C类型;它可能是CCD_ 2的typedef。
您的源文件具有以下#include
指令:
#include <libnet.h>
#include <stdio.h>
<stdio.h>
不能定义u_char
,所以它必须在<libnet.h>
中定义——特别是在源文件所依赖的<libnet.h>
的任何版本中。
这是一个非标准的头(我的系统上没有安装),所以我的最佳猜测是,您使用的libnet版本与reset-tcp.c
设计使用的版本不同。
我知道这不能解决你的问题,但它应该给你一个好的起点。
编辑:
我刚刚在Ubuntu 12.04系统(u_char
2的1.1.4-2.1版本)上安装了libnet1
、libnet1-dev
和libnet1-doc
软件包。您的源文件现在编译时(在连接第74行和第75行之后)出现了一些警告。类型u_char
在/usr/include/i386-linux-gnu/sys/types.h
中定义,CCD_14由libnet.h
间接包括。
我确实收到了一些警告:
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘u_char *’ [-Wformat]
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘u_char *’ [-Wformat]
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 5 has type ‘u_char *’ [-Wformat]
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 6 has type ‘u_char *’ [-Wformat]
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘u_char *’ [-Wformat]
291.c:95:1: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 8 has type ‘u_char *’ [-Wformat]
291.c:116:1: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
你一定要注意;代码当前尝试将CCD_ 16值存储在CCD_。
建议:
告诉我们您使用的是什么操作系统和
libnet
的哪个版本;如果我们掌握了这些信息,有人可能会提供更好的建议。让我们知道源代码来自哪里,看看你是否能找到它应该使用的
unsigned char
0版本。
您需要安装libnet
及其开发包。
在Debian下,您可以通过安装包libnet1
和libnet-dev
来完成此操作。