IT/webhacking

[webhacking.kr] Challenge 14

안선생 Dr.Ahn 2023. 4. 21. 16:10
728x90
반응형

old - 14

 

<html>
<head>
<title>Challenge 14</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
</style>
</head>
<body>
<br><br>
<form name=pw onsubmit=ck()><input type=text name=input_pwd><input type=button value="check" onclick=ck()></form>
<script>
function ck(){
  var ul=document.URL;
  ul=ul.indexOf(".kr");
  ul=ul*30;
  if(ul==pw.input_pwd.value) { location.href="?"+ul*pw.input_pwd.value; }
  else { alert("Wrong"); }
  return false;
}
</script>
</body>
</html>

 

1. ul = URL 현재 페이지 주소

2. ul = indexOf(".kr"); : .kr의 index는 18 

3. *30

540

개발자도구(option+cmd+i) -> console -> ul = ..순서대로 작성하면 답 나옴.

 

 

Q...이것도 이렇게 계산해서 푸는게 맞는지 모르겠다...

728x90
반응형