저장소
[webhacking.kr] 10번 풀이 본문
Webhacking.kr
Index Welcome Stranger! Chatting Notice(en) [2021-04-16] Score of old challenges has been adjusted to 1/10. For a while now, new challenges will be added "without" notice. [2020-08-12] Replace chat feature with Discord. Please do not cause inconvenience to
webhacking.kr

10번 문제는 HTML 관련 문제다. Goal 라인이 그려져있다.
크롬 기준 Ctrl + Shift + l 단축키를 사용해서 소스코드를 확인했다. 소스코드는 아래와 같았다.
<html>
<head>
<title>Challenge 10</title>
</head>
<body class="vsc-initialized">
<hr style="height: 100; background: brown;" />
<table border="0" width="1800" style="background: gray;">
<tbody>
<tr>
<td>
<a
id="hackme"
style="position: relative; left: 0; top: 0;"
onclick="this.style.left=parseInt(this.style.left,10)+1+'px';if(this.style.left=='1600px')this.href='?go='+this.style.left"
onmouseover="this.innerHTML='yOu'"
onmouseout="this.innerHTML='O'"
>
O
</a>
<br />
<font style="position: relative; left: 1600; top: 0;" color="gold">
|<br />
|<br />
|<br />
|<br />
Goal
</font>
</td>
</tr>
</tbody>
</table>
<hr style="height: 100; background: brown;" />
</body>
</html>

소스코드에서 알 수 있듯이 O에 마우스 커서를 올리면 yOu로 바뀌고(onmouerover) 클릭 시 left position이 1px씩 증가하면서 앞으로 움직인다. solve 조건을 찾아보면 this.style.left == '1600px' 임을 알 수 있다. Goal 라인이 별도로 존재하지만 중요한 것은 O를 1600px로 옮기는 것이다.

하지만 1px씩 움직이기엔 시간이 너무 오래걸린다. 그래서 O를 클릭할 때마다 값이 지속적으로 업데이트되는 left position 값을 적당히 1580으로 주고 직접 클릭해서 1600이 되도록 시도해보았다.

문제 풀이에 성공했다.
+)

this.style.left의 조건값을 임의로 수정했을 땐 no hack 이라는 메시지가 아래에 출력된다.
'IT > 웹 해킹' 카테고리의 다른 글
[웹 해킹] 참고자료 및 문제 풀이 사이트 (0) | 2021.08.30 |
---|---|
[webhacking.kr] 26번 풀이 (0) | 2021.08.30 |
[webhacking.kr] 25번 풀이 (0) | 2021.08.27 |
[webhacking.kr] 24번 풀이 (0) | 2021.08.27 |
[webhacking.kr] 12번 풀이 (0) | 2021.08.23 |