본문 바로가기

wargame/WEBHACKING.kr

[WEBHACKING.kr]16

16

꽃이 두 개 그려진 것 같은 문제.



소스코드를 확인해보았다.


<html>
<head>
<title>Challenge 16</title>
<body bgcolor=black onload=kk(1,1) onkeypress=mv(event.keyCode)> 
<font color=silver id=c></font>
<font color=yellow size=100 style=position:relative id=star>*</font> 
<script> 
document.body.innerHTML+="<font color=yellow id=aa style=position:relative;left:0;top:0>*</font>";

function mv(cd) // id가 start인 *을 움직이는 함수, cd는 경우를 나눌 때 사용한다
{
kk(star.style.posLeft-50,star.style.posTop-50); // start의 좌표를 이동한다
if(cd==100) star.style.posLeft=star.style.posLeft+50; // cd가 100일 때 다음과 같이 이동한다
if(cd==97) star.style.posLeft=star.style.posLeft-50;// cd가 97일 때 다음과 같이 이동한다
if(cd==119) star.style.posTop=star.style.posTop-50;// cd가 119일 때 다음과 같이 이동한다
if(cd==115) star.style.posTop=star.style.posTop+50;// cd가 115일 때 다음과 같이 이동한다
if(cd==124) location.href=String.fromCharCode(cd);// cd가 124일 때 124에 해당하는 문자로 변환하여 이동한다.
}


function kk(x,y) // 임의의 색을 가진 *을 생성하는 함수, x와 y는 좌표값
{
rndc=Math.floor(Math.random()*9000000); // 랜덤으로 0 - 9000000 사이의 정수를 선택한다
document.body.innerHTML+="<font color=#"+rndc+" id=aa style=position:relative;left:"+x+";top:"+y+" onmouseover=this.innerHTML=''>*</font>";
} // 색이 #rndc, id가 aa, 위치가 (x, y)인 *를 만든다. 이 때 마우스를 갖다대면 사라진다

</script>
</body>
</html>



함수를 해석해봐도 어떻게 해야하는지 잘 몰라서 124에 해당하는 값을 눌러 변화를 지켜보기로 하였다. |를 눌러 확인해보니 password가 나왔다.



auth에 password를 입력하면 성공.



'wargame > WEBHACKING.kr' 카테고리의 다른 글

[WEBHACKING.kr]24  (0) 2019.07.01
[WEBHACKING.kr]17  (0) 2019.07.01
[WEBHACKING]모든 포스트 목록  (0) 2019.06.02
[WEBHACKING.kr]21  (0) 2019.05.29
[WEBHACKING.kr]22  (0) 2019.05.27