제리의 블로그

pwnable.kr flag 본문

Wargame/pwnable.kr

pwnable.kr flag

j3rrry 2018. 8. 29. 00:53

flag - 7 pt


Papa brought me a packed present! let's open it.

Download : http://pwnable.kr/bin/flag

This is reversing task. all you need is binary

이번 문제는 리버싱 분야입니다.




디버깅해보니 섹션정보도 일반 바이너리와 달랐고

SYS_mmap 로 새로운 메모리 할당하는 것을 보고 패킹을 의심했었고

# strings ./flag

...

UPX! UPX!

문자열 검사를 해보니

UPX 패킹이 되어있었습니다.




언패킹을 해주면
mov     edi, offset aIWillMallocAnd ; "I will malloc() and strcpy the flag there. take it."
call    puts
mov     edi, 64h
call    malloc
mov     [rbp+var_8], rax
mov     rdx, cs:flag                ; "UPX...? sounds like a delivery service :)"
mov     rax, [rbp+var_8]
mov     rsi, rdx
mov     rdi, rax
call    strcpy_0

malloc 으로 할당한 다음

flag 를 strcpy 하는 코드였습니다.

'Wargame > pwnable.kr' 카테고리의 다른 글

pwnable.kr random  (0) 2018.08.30
pwnable.kr passcode  (0) 2018.08.29
pwnable.kr bof  (0) 2018.08.24
pwnable.kr collision  (0) 2018.08.24
pwnable.kr fd  (0) 2018.08.24
Comments