WEB/webhacking.kr
Webhacking.kr - 16번 [100]
Notchicken
2017. 5. 24. 14:55
Webhacking.kr - 16번 [100]
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)
{
kk(star.style.posLeft-50,star.style.posTop-50);
if(cd==100) star.style.posLeft=star.style.posLeft+50;
if(cd==97) star.style.posLeft=star.style.posLeft-50;
if(cd==119) star.style.posTop=star.style.posTop-50;
if(cd==115) star.style.posTop=star.style.posTop+50;
if(cd==124) location.href=String.fromCharCode(cd);
}
function kk(x,y)
{
rndc=Math.floor(Math.random()*9000000);
document.body.innerHTML+="<font color=#"+rndc+" id=aa style=position:relative;left:"+x+";top:"+y+" onmouseover=this.innerHTML=''>*</font>";
}
</script>
</body>
</html>
소스의 키이벤트 이용부분을 확인하여, d a w s 를 이용하여 별을 상하좌우로 움직이고
| 키를 눌렀을 때, 그 값을 url로 하여 이동하는 것을 알 수 있었다.
| 키를 눌러 해당 url로 이동하면 password 값을 확인할 수 있다.
Password = webhacking.kr