old-42 (200)
첫 화면이다.

test.txt
옆 download 버튼을 클릭하면 아래와 같은 내용의 파일이 다운로드 된다.
~
❯ cat test.txt
test123
qwer123
asdf234
flag.docx 옆 download 버튼을 클릭하면 아래와 같은 창이 뜨며 다운로드 되지 않는다.

페이지 소스는 아래와 같다.
<html>
<head>
<title>Challenge 42</title>
</head>
<body>
<table border=1 align=center width=300>
<tr><td width=50>no</td><td>subject</td><td>file</td></tr>
<tr><td>2</td><td>test</td><td>test.txt [<a href=?down=dGVzdC50eHQ=>download</a>]</tr>
<tr><td>1</td><td>read me</td><td>flag.docx [<a href=javascript:alert("Access%20Denied")>download</a>]</td></tr>
</table>
</body>
</html>
코드 8번째 줄의 dGVzdC50eHQ=
는 Base64 디코딩 시 test.txt
가 된다.
flag.docx
를 Base64 인코딩 시 ZmxhZy5kb2N4
가 되므로 https://webhacking.kr/challenge/web-20/?down=ZmxhZy5kb2N4 에 접속하면 flag.docx
파일이 다운로드 된다.
Word로 파일을 열어보면 아래와 같이 플래그가 적혀있다.

Auth 창에 플래그를 입력하면 문제가 풀린다.

Last updated
Was this helpful?