hacknote

6 篇文章 0 订阅

0x0804A050  指针数组 32位

1.alloc

            malloc(0x8) == >chunk(0x10)

                     struct note {函数地址,内容指针}

            malloc(size)

2.del

           free(note.内容指针)

           free(note)

3.print

          s[idx](s[idx])

4.exit

free(fastbin) 会修改chunk->fd//用于链表

只有在申请note时才能写入数据

默认的函数地址执行puts(s[idx].内容)

所以只要能修改 内容指针就能 任意地址读

修改函数地址就能 执行函数

当des0_chunk.size == note0_chunk.size

free idx0 

fastbin --> note0_chunk --> des0_chunk

再申请时,也无法修改note0_chunk

所以des0_chunk.size != note0_chunk.size

free idx1 free idx0

使得 fastbin --> note0_chunk --> note1_chunk

再malloc(0x8)

使得能修改 note1_chunk的内容

修改为 sub_804862B + got.read

即执行puts(got.read)

成功泄露lib地址

再free idx2

fastbin --> note1_chunk -->note0_chunk

再malloc(0x8)

使得修改note0_chunk内容

修改为system地址

执行m_print 即 s[0](s[0]) --> system(poc2) -- >p32(system_addr) + 4位字符 

system(system_addr 肯定执行失败)

利用system的特点 分段执行 ,前面指令执行完成(成功或者失败),会执行后面指令

即system(XXXX;sh)

成功拿到shell

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值