HackChang

[Suninatas] 써니나타스 7번 문제 풀이 본문

W4RG4M3/W3B

[Suninatas] 써니나타스 7번 문제 풀이

HackChang 2020. 7. 31. 15:38

LEVEL7

이번 문제도 웹문제다..

해당 페이지의 소스를 보도록 하겠다.

 


<!DOCTYPE html>

<head>
    <title>Game 07</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" href="/static/img/game.ico" />
    <script>
        function noEvent() {
            if (event.keyCode == 116 || event.keyCode == 9) {
                alert('No!');
                return false;
            }
            else if (event.ctrlKey && (event.keyCode = 78 || event.keyCode == 82)) {
                return false;
            }
        }
        document.onkeydown = noEvent;
    </script>
</head>
<body onload="javascript:document.frn.wen07.focus();">
    <form method="get" name="frn">
        <div align="center">
            <input type="text" name="wen07" value="Do U Like girls?">
        </div>
    </form>
    <form method="post" action="./web07_1.asp" name="frm">
        <div align="center">
            <input type="button" name="main_btn" value="main" style="width: 60" onclick="location.href = '/'">&nbsp&nbsp&nbsp
            <input type="button" name="main_btn" value="Back" style="width: 60" onclick="history.back()">
        </div>
        <div align="center">
            <input type="hidden" name="web07" value="Do U Like girls?">
        </div>
        <div align="center">
            <img src="./iu.gif" width="700" height="1000" name="iu">
        </div>
       
        <div align="center">
            <input type="submit" value="YES">
        </div>
    
        <div align="center">
            <img src="./yoona.gif" alt="yoona" width="700" height="1000">
        </div>
    </form>
</body>

<!-- Hint : Faster and Faster -->
<!-- M@de by 2theT0P -->

br태그가 너무 많아서 해당 태그는 제거한 소스다.

스크립트 부분을 보면

몇 개의 키를 막는 것을 볼 수 있다.

https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

 

Virtual-Key Codes (Winuser.h) - Win32 apps

The following table shows the symbolic constant names, hexadecimal values, and mouse or keyboard equivalents for the virtual-key codes used by the system. The codes are listed in numeric order.

docs.microsoft.com

위에서 키코드에 대한 키를 알 수 있다.

여기서 막는 키를 정리해보면

116 = 0x74 = F5

9 = Tab

78 = 4e = N

82 = 52 = R

이므로, F5, Tab, Ctrl+N, Ctrl+R을 막는 것을 알 수 있고,

또한 소스에 보면 힌트로 Faster and Faster라는 내용을 확인할 수 있었다.

 

페이지를 내리다보면 YES라는 버튼이 있고, 클릭을 하면

위와같은 메세지창이 출력되고, 다시 페이지로 돌아온다.

힌트로 봐서는 해당 버튼을 빨리 클릭해야 된다는 문제로 생각됐다.

소스를 보면 YES버튼이 form안에 있는 것을 볼 수 있고,

해당 form의 이름은 frm이다.

개발자도구를 이용해서 해당 버튼을 실행해보도록 하겠다.

 

이렇게 콘솔창에 document.frm.submit()을 하면 해당 폼의 submit을 해준다.

하지만 문제에서는 빠르게 submit을 하라고 했기 때문에 해당 페이지를 새로고침 후 submit을 해보도록 하겠다.

document.reload

document.frm.submit() 을 하면 새로고침 후 submit이 된다.

 

콘솔창에서 방향키 위버튼을 눌러 빠르게 입력을 하면 

 

이런 메세지창이 출력되면서

 

키 값이 나오는 것을 확인할 수 있다.

 

 

Comments