본문 바로가기

Web Security/webhacking.kr

[Webhacking.kr] old-10

old-10

This problem is in webhacking.kr.
URL: https://webhacking.kr/challenge/code-1//

If you enter the URL, you can see the below photo.

 

First, View Source

<html>
<head>
<title>Challenge 10</title>
</head>

<body>
<hr style=height:100;background:brown;>
<table border=0 width=1800 style=background:gray>
<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>
</table>
<hr style=height:100;background:brown;>
</body>
</html>

The HTML of the page is composed like this. If you look closely at this code, you can look at this.

if(this.style.left=='1600px')this.href='?go='+this.style.left"   

This code is included in a tag. In addition, you can know that the ID of A tag is "hackme".
Thus, we should change the value of "this.style.left" to '1600px'.

To manipulate it opens the developer tool window.

 

Then, Modify the code like this.

(Before)
onclick="this.style.left=parseInt(this.style.left,10)+1+'px';

(After)
onclick="this.style.left=1600+'px';

After modifying like this, click 'O' of the page.
Then, you can get to the point of problem 10.

 

'Web Security > webhacking.kr' 카테고리의 다른 글

[Webhacking.kr] old-13  (0) 2021.08.01
[Webhacking.kr] old-11  (0) 2021.08.01
[Webhacking.kr] old-9  (0) 2021.08.01
[Webhacking.kr] old-7  (0) 2021.08.01
[Webhacking.kr] old-5  (0) 2021.08.01