old-16

js를 펴보자 

<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.left-50,star.style.top-50);
  if(cd==100) star.style.left=parseInt(star.style.left+0,10)+50+"px";
  if(cd==97) star.style.left=parseInt(star.style.left+0,10)-50+"px";
  if(cd==119) star.style.top=parseInt(star.style.top+0,10)-50+"px";
  if(cd==115) star.style.top=parseInt(star.style.top+0,10)+50+"px";
  if(cd==124) location.href=String.fromCharCode(cd)+".php"; // do it!
}
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>

event.keyCode를 받고 cd가 124이면 php 실행하길래 124 ascii로 |이길래 눌러봄 

긁적 

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

[WebHacking.kr] old-20번 문제 풀이 (Write-up)  (0) 2026.02.16
[WebHacking.kr] old-54번 문제 풀이 (Write-up)  (0) 2026.01.12
old-39  (0) 2025.04.20
old-26  (0) 2025.04.20
old-15  (0) 2025.04.20