gpt4 book ai didi

python - 将 shellcode 发送到 Windows 中的交互式 C 程序

转载 作者:行者123 更新时间:2023-11-30 14:59:07 25 4
gpt4 key购买 nike

我正在尝试利用 C 程序中的缓冲区溢出漏洞,我可以控制 EIP,但我不知道如何将有效负载发送到程序。来源如下:

#include <cstdio>

int main() {
char name[32];
printf("Enter your name and press ENTER\n");
scanf("%s", name);
printf("Hi, %s!\n", name);
return 0;
}

如何在 name 变量中插入有效负载(BUFF + EIP + NOPs + Shellcode)?在 Linux 中,类似于 $(python -c 'print "BUFF + EIP + NOPs + Shellcode') 我如何在 Windows 中执行此操作?如果可能的话,使用 python 脚本。

谢谢。

最佳答案

如果管道功能不可用,您可以使用临时文件来管道负载。

作为

python -c 'print "BUFF + EIP + NOPs + Shellcode' > payload.txt
vulnbrable_binary.exe < payload.txt

关于python - 将 shellcode 发送到 Windows 中的交互式 C 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42997678/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com