티스토리 뷰

 

키보드 입력시 랜덤하게 *문자 생성

 

<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>

 

if(cd==124) location.href=String.fromCharCode(cd); 부분이 의심된다.

JavaScript의 location.href를 통해 다른 페이지로 이동해보자.

https://www.w3schools.com/jsref/prop_loc_href.asp

 

onkeypress의 event.keycode 참조.

(onkeydown때와 다르다고 함)

event.keycode == 124를 만족시켜주기위한 | 문자 입력

=> 사이트 이동과 flag 출력.

 

 

'Security&Hacking > WebHacking.kr' 카테고리의 다른 글

WebHacking.kr) Q24. wrong ip  (0) 2019.09.11
WebHacking.kr) Q18. SQL Injection  (0) 2019.09.11
WebHacking.kr) Q17. unlock  (0) 2019.09.11
WebHacking.kr) Q14. ck()  (0) 2019.09.11
WebHacking.kr) Q6. index.phps  (0) 2019.09.11
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함