刚看完题目觉得和前面的level3差不多,只是没有给libc而已。。。
看完大佬的exp之后整个人都不好了。。。。。果然我还是太菜了
32位开了NX
sub_8048484,read函数,明显的栈溢出
思路:利用DynELF泄露出system的地址,因为没有/bin/sh所以我们需要利用read函数手动写入,bss段有写的权限所以可以写到bss,之后再溢出执行system命令即可getshell
DynELF使用方法可参考:https://www.jianshu.com/p/7ac44360ffc9
需要注意的是使用DynELF后需要用调用start函数恢复栈平衡。
exp:
pppr是三次pop的地址,目的是为了弹出read的参数平衡栈。可以通过ROPgadget工具搜索pop找到
这两条都可以
i春秋的rop原理讲解的很详细:https://www.ichunqiu.com/course/63279