Wargame/Webhacking.kr

[Webhacking.kr] Old 17

핏디 2021. 7. 28. 00:07
SMALL

[문제]


[풀이]

<html>
<head>
<title>Challenge 17</title>
</head>
<body bgcolor=black>
<font color=red size=10></font>
<p>
<form name=login>
<input type=passwd name=pw><input type=button onclick=sub() value="check">
</form>
<script>
unlock=100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+1/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10+100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10-100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10+9999999;
function sub(){ if(login.pw.value==unlock){ location.href="?"+unlock/10; } else{ alert("Wrong"); } }
</script>

문제의 소스코드를 확인하니 unlock에서 계산된 값을 login.pw.value와 비교하여 get 방식으로 ?unlock/10을 보내고 있었다.

 

<form> 태그를 보면 login의 pw가 우리가 입력하는 입력 창임을 알 수 있다.

 

따라서 Console 창에서 unlock 변수에 들어갈 값을 계산해보면 7809297.1이 된다.

즉, 이 값을 입력 창에 입력해주면 되는 것이다!

 

 

https://webhacking.kr/challenge/js-4/?780929.71 

 

url 또한 unlock/10의 값이 파라미터로 연결된 것을 볼 수 있다.

LIST

'Wargame > Webhacking.kr' 카테고리의 다른 글

[Webhacking.kr] Old 26  (0) 2021.08.04
[Webhacking.kr] Old 18  (0) 2021.07.28
[Webhacking.kr] Old 16  (0) 2021.07.27
[Webhacking.kr] old-15  (0) 2021.07.22
[Webhacking.kr] old-14  (0) 2021.07.22