WarGame/DigitalForensic with CTF

[DigitalForensic] with CTF basisSixtyFour…

문제 제목부터가 base64를 이용한 문제임을 암시한다. 자료를 다운로드 받아서 Password를 이용해서 열어보면 다음과 같은 사진을 얻을 수 있다.

사진은 정상적으로 open되지는 않으니 HxD로 검사해보자

문자열이 base64 인코딩된 값으로 보인다. 이를 decoding하면 png파일의 bytes열을 확인할 수 있다. png로 저장해서 확인하자

import base64

if __name__=="__main__" :

    str_val = "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAIAAAAHjs1qAAAABmJLR0QA/wD/AP+gvaeTAAAE5klEQVR4nO3dQa7qOBRAwdDq/W/59QqCZNrGDqdq+hHk8Y88uDHO6+/v74KGf3ZfAHyP3AmROyFyJ0TuhMidELkTIndC/n3zb6/X62vX8X/c3Sm7u/7Vd9Zmfe7q6x99/6f3cFndSZE7IXInRO6EyJ0QuRMid0Lezd3v7PpFyOjcd9ace/T9Z90HeMr8+yk9XFZ3UuROiNwJkTshcidE7oTInZBP5u53Zs2DT9uPPvp3rX7/WXP91fP7A3uwuhMid0LkTojcCZE7IXInRO6EzJy7n2bWvHyWp5978wOs7oTInRC5EyJ3QuROiNwJkTshvzx3P+2cltXnsq/+3B9gdSdE7oTInRC5EyJ3QuROiNwJmTl3f8p8d9a577POdVn9+l373Q/swepOiNwJkTshcidE7oTInRC5E/LJ3P2053re2TXnPs2sv/fOU76Hy+pOitwJkTshcidE7oTInRC5E/I6cFPyaqfNiXfNxYP/9VZ3QuROiNwJkTshcidE7oTInZCZc/dd+8VXz61Hrd5nP8uuc+I33k+wuhMid0LkTojcCZE7IXInRO6EfOO5qqvnyrvmuKedY3PaeTgHnmNjdSdE7oTInRC5EyJ3QuROiNwJebfffdfcdPUcetRp59Lc2fW7glm+cJ1Wd0LkTojcCZE7IXInRO6EyJ2QT86Z2TX/HrX6OlfP4087D+e09/+A1Z0QuRMid0LkTojcCZE7IXIn5N05M7Pmyk85L2XXnP4p5+HcOe2+iv3ucF1yJ0XuhMidELkTIndC5E7Iu7n7aefJnHaOymn3Ae7smouf9hzZy+pOitwJkTshcidE7oTInRC5EzLzuaqr5+JP2Y/+lP3fs17/lP3xl9WdFLkTIndC5E6I3AmROyFyJ+ST891v32vx3HeWXeeyH3je+RQPOife6k6I3AmROyFyJ0TuhMidELkTMvO5qqvPCz9tTn/auTer7foeRjnfHa5L7qTInRC5EyJ3QuROiNwJ+cbcffR97pw23x21677E6PuM2vU7B89VhXfkTojcCZE7IXInRO6EyJ2Qd+e7P32+fto563dWX+dp++ad7w7fIHdC5E6I3AmROyFyJ0TuhJx4zsyd0+b9tb93tS/M463uhMidELkTIndC5E6I3AmROyEz97uvnk8/6PmdQ3bt73/K+Tx3nDMD78idELkTIndC5E6I3AmROyHv5u6jc9zVr1/tKfvLd13nqF33Md6wuhMid0LkTojcCZE7IXInRO6EfLLf/TR3c9zROfeu82FW/x5gll2/N5jI6k6I3AmROyFyJ0TuhMidELkT8m7ufucpzyvdtY9813k7d057Tu3GffBWd0LkTojcCZE7IXInRO6EyJ2QT+bud3btF59l1xx61OrPPe13DhP/X6zuhMidELkTIndC5E6I3AmROyEz5+6nmbV//bTnla6+v7F6v/6oifcZrO6EyJ0QuRMid0LkTojcCZE7Ib88d991zsysefbo5446bV/7qA++T6s7IXInRO6EyJ0QuRMid0LkTsjMufuuc1fu7DqPfOP55UOefp/hg+/T6k6I3AmROyFyJ0TuhMidELkT8snc/Vf3Sd857Xmoo69/yrn7s75P+93huuROitwJkTshcidE7oTInZDXaZuwYR2rOyFyJ0TuhMidELkTIndC5E6I3An5DzfRISTqGHbgAAAAAElFTkSuQmCC"

    with open("result.png","wb") as f:
        f.write(base64.b64decode(str_val))

QR_Code를 얻을 수 있으며, 해당 QR-Code를 해석하면 flag를 얻을 수 있다.