pwnable.kr之bof

打开题目:

 

 

 

 

 

 

 

 

 

 

 

 

 

先下载题目给我们的两个文件,查看文件信息:

发现没有执行的权限,所以先增加文件bof的执行权限,执行:

没发现啥,然后查看代码,

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stdlib.h>
 4 void func(int key){
 5     char overflowme[32];
 6     printf("overflow me : ");
 7     gets(overflowme);    // smash me!
 8     if(key == 0xcafebabe){
 9         system("/bin/sh");
10     }
11     else{
12         printf("Nah..\n");
13     }
14 }
15 int main(int argc, char* argv[]){
16     func(0xdeadbeef);
17     return 0;
18 }

还没写完,吃完饭接着写

猜你喜欢

转载自www.cnblogs.com/countfatcode/p/11139006.html
今日推荐