我有以下原恒星挑战
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
void getpath()
{
char buffer[BUFFSIZE];
char flagBuffer[64];
FILE *fp;
unsigned int ret;
printf("input path please: "); fflush(stdout);
gets(buffer);
ret = __builtin_return_address(0);
if((ret & 0xff000000) == 0xff000000) {
printf("bzzzt (%p)\n", ret);
_exit(1);
}
printf("got path %s\n", buffer);
}
int main(int argc, char **argv)
{
getpath();
}
Run Code Online (Sandbox Code Playgroud)
并将其编译为 64 位
gcc stack5.c -DBUFFSIZE=64 -no-pie -fno-stack-protector -O0 -o stack5
Run Code Online (Sandbox Code Playgroud)
我正在使用 pwntools 来制作我的漏洞利用程序。这是我的exploit.py 文件
from pwn import *
exe = './stack5'
context.clear(arch='amd64')
context.kernel = 'amd64' …
Run Code Online (Sandbox Code Playgroud)