카테고리 없음

challenge-level2

그라파나 2022. 5. 16. 17:39

아니 이게 끝이야?

http://suninatas.com/challenge/web02/web02.asp

 

뭐야 ? 아이디랑 패스워드 입력하라고?

 

내 아이디를 입력했다. 

 

같은 화면 그대로다.

 

뭔가 이상한데? 개발자 도구를 켰다.

 

<!DOCTYPE html>

<html>
<head>
    <title>Game 02</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" href="/static/img/game.ico" />
</head>
<body>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <form method="post" name="web02">
        <table width="240" cellpadding="0" cellspacing="0" align="center">
            <tr height="30">
                <td colspan="2" bgcolor="cccccc" align="center"><b>LEVEL 2</b></td>
            </tr>
            <tr height="30">
                <td colspan="2" width="100%" class="table_top" align="right">
                    <input type="button" name="main_btn" value="main" style="width: 60" onclick="location.href = '/'">&nbsp<input type="button" name="main_btn" value="Back" style="width: 60" onclick="history.back()"></td>
            </tr>
            <tr height="30" class="table_main">
                <td width="90" align="center" bgcolor="cccccc"><font size="2"><b>ID</b></font></td>
                <td width="150" align="center" bgcolor="cccccc">
                    <input type="text" name="id" style="width: 140"></td>
            </tr>
            <tr height="30" class="table_main">
                <td width="90" align="center" bgcolor="cccccc"><font size="2"><b>PW</b></font></td>
                <td width="150" align="center" bgcolor="cccccc">
                    <input type="password" name="pw" style="width: 140"></td>
            </tr>
            <tr height="30">
                <td colspan="2" align="center" class="table_top">
                    <input type="button" value="Join" style="width: 60" onclick="chk_form()">
            </tr>
            <tr height="30" class="table_main">
                <td colspan="2" align="center" bgcolor="cccccc">Authkey : ?????</td>
            </tr>
        </table>
</body>
</html>
<script>
	function chk_form(){
		var id = document.web02.id.value ;
		var pw = document.web02.pw.value ;
		if ( id == pw )
		{
			alert("You can't join! Try again");
			document.web02.id.focus();
			document.web02.id.value = "";
			document.web02.pw.value = "";
		}
		else
		{
			document.web02.submit();
		}
	}
</script>
<!-- Hint : Join / id = pw -->
<!-- M@de by 2theT0P -->

일단 힌트가 보였다. id랑 pw는 같다고??

 

그래서 id 1 pw 1을 입력해봤다.

훗, 다시해보렴

아니? 이 자식이..?

그래도 뭔가 상태가 바뀌었다.

그래서 다시 코드를 보니.

	function chk_form(){
		var id = document.web02.id.value ;
		var pw = document.web02.pw.value ;
		if ( id == pw )
		{
			alert("You can't join! Try again");
			document.web02.id.focus();
			document.web02.id.value = "";
			document.web02.pw.value = "";
		}
		else
		{
			document.web02.submit();
		}
	}

아? 버튼을 누르니까 이렇게 되는구나.

id = pw일때 alert이 뜨고 백이 되는 거니까. 저 구문이 문제다.

결과적으로 submit();을 해야하는거니까. 

값을 입력해 놓고 document.web02.submit();만 콘솔에서 실행하면 안될까?

 

id, pw 둘다 1로 입력하고 콘솔창을 열어서 콘솔에 입력했다.
키가 나왔다!

값을 입력해 놓고 document.web02.submit();만 콘솔에서 실행하면 안될까? -> 이걸 바이패스라 카더라.

패스 2번째다ㅠㅠ 감격

2번까지 풀고나서 느낀점.

1. 바이패스란 이런것이구만

2. 어려운데 재밌다.

3. 재밌는데 고통스럽다.