2016-05-12 4 views
0

GCC(Linux Derbian)を使用してexploit-dbからいくつかのスクリプトをコンパイルしようとしていますが、gccコマンドを発行してコードをコンパイルすると(gcc -o test test.c)ファイル "linux/linkage.h"と "asm/page.h"が見つかりませんでした。Cヘッダー(GCC)

私が$ locate linkage.hコマンドを発行したとき、これらのファイルは "/usr/src/linux-headers-4.3.0-kali1-common/include/linux/linkage.h"にあり、 /usr/src/linux-headers-4.3.0-kali1-common/include/asm/page.h "と入力します。

GCCにこのパスを考慮させるかどうか、あるいは標準パスを変更するように指示はありますか?

以下に、私がコンパイルしようとしているコードのいくつかの行を見つけることができます。

/* 
* Linux kernel 2.4 uselib() privilege elevation exploit. 
* 
* original exploit source from http://isec.pl 
* reference: http://isec.pl/vulnerabilities/isec-0021-uselib.txt 
* 
* I modified the Paul Starzetz's exploit, made it more possible 
* to race successfully. The exploit still works only on 2.4 series. 
* It should be also works on 2.4 SMP, but not easy. 
* 
* thx newbug. 
* 
* Tim Hsu <timhsu at chroot.org> Jan 2005. 
* 
*/ 

#define _GNU_SOURCE 
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <fcntl.h> 
#include <unistd.h> 
#include <errno.h> 
#include <sched.h> 
#include <syscall.h> 
#include <limits.h> 

#include <sys/types.h> 
#include <sys/wait.h> 
#include <sys/time.h> 
#include <sys/mman.h> 
#include <sys/sysinfo.h> 

#include <linux/elf.h> 
#include <linux/linkage.h> 

#include <asm/page.h> 
#include <asm/ldt.h> 
#include <asm/segment.h> 

#define str(s) #s 
#define xstr(s) str(s) 

答えて

0

、フラグを含む

gcc -I"/usr/src/linux-headers-4.3.0-kali1-common/include/" -o test test.c 
を使用
関連する問題