> For the complete documentation index, see [llms.txt](https://docs.cooku222.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cooku222.kr/security/web-hacking/suninatas/suninatas-game-02.md).

# \[SuNiNaTaS] Game 02

문제 출처 : <http://suninatas.com/challenge/web02/web02.asp>

***

<figure><img src="https://blog.kakaocdn.net/dna/ZsvjK/dJMcag4XYet/AAAAAAAAAAAAAAAAAAAAAL8kLtGFW6gK5cDQAZddt9AJ8tEzVDVBkbMXlxaQ9HqF/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=Pki%2FYCMxQfbTrwitNAVn25BV1xw%3D" alt="" height="305" width="382"><figcaption></figcaption></figure>

&#x20;\
asp로 작성된 로그인 화면이 나온다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/v7aI7/dJMb995Qgdo/AAAAAAAAAAAAAAAAAAAAAFCUsoLI6BKW7E9U9gR6XRKUpgkVd4RTCzlRk0FWFFWv/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=jEwixEHCTAZ%2Ba2%2FaWTGZ45qG5Pg%3D" alt="" height="418" width="511"><figcaption></figcaption></figure>

우선 코드를 보기 위해 \[개발자 도구] - \[소스] 탭을 확인한다. \
일단 하단에 id와 pw 입력값이 같으면 join이 된다는 주석이 달려있다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/cfeOY6/dJMb99LxunO/AAAAAAAAAAAAAAAAAAAAAI_Hh564oXbM7GrfzExGO7gYhF0x8t8tJKD01K1i6DTW/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=uxbgebusII0RabXUzwempcGNuTw%3D" alt="" height="342" width="417"><figcaption></figcaption></figure>

ID:1111, PW:1111로 입력하고 넣어줘본다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/bmr2go/dJMcacO1PF2/AAAAAAAAAAAAAAAAAAAAAHHRRYLlHo-U2kUzswgUJNhT7kXTB0ixffbahQhBMq4E/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=005aflsdS%2Bpkz60S0welAMf3EVM%3D" alt="" height="182" width="562"><figcaption></figcaption></figure>

가입에 실패해 다시 확인해본다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/5BrmF/dJMcahCNTkl/AAAAAAAAAAAAAAAAAAAAAK5xE6mg6wbgjWWLyx1-zsHuCkMRavwnI0gzil0XXChT/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=GXvcXGB9qVVMn8xMOLDKiseNtHU%3D" alt="" height="313" width="597"><figcaption></figcaption></figure>

위 화면은 자바스크립트로 입력값을 받고 submit() 함수로 바로 폼을 전송 후 alert() 처리를 받는 것을 알 수 있다. \
그럼 우리는 아이디와 비번을 같은 값을 입력했을 때 가입이 되도록 할 수 있다.\
javascript로 if문의 조건문만 수정해주면 된다.

<figure><img src="https://blog.kakaocdn.net/dna/bHeSx3/dJMcagjAUrs/AAAAAAAAAAAAAAAAAAAAAK1xW_dyDua-bHJaSFZwzwEoZ6gUJ8Jv2iNtTL9jJQ7y/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=RPYvKwchakUXAJdj569LM6agRFk%3D" alt="" height="362" width="383"><figcaption></figcaption></figure>

같지 않을때 경고창 띄우는 걸로 수정해준뒤 콘솔창에 입력해 덮어쓰면 된다.\
원래 코드에서 오류가 난 이유는 조건문에서 id와 pw가 같을 때 사이트에 가입하지 못하게 작성되어있었기 때문이다.\
그렇게 되면 기존 화면의 코드는 작동하지 않고, 콘솔에 덮어써준 코드만 작동하게 된다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/A4gn5/dJMcagcPkQf/AAAAAAAAAAAAAAAAAAAAABnd13P27dR9yaysNytYV3PcklClRIQL_O0hEYHj3giw/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=c5hrbtiiNcTR0s62wPEyeJIAgyI%3D" alt="" height="311" width="412"><figcaption></figcaption></figure>

Authkey가 출력되고 이를 메인 화면의 인증칸에 입력해주면 된다.&#x20;

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cooku222.kr/security/web-hacking/suninatas/suninatas-game-02.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
