> 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/lord-of-sql-injection/lord-of-sqlinjection-goblin.md).

# \[Lord Of SQLInjection] Goblin

<figure><img src="https://blog.kakaocdn.net/dna/mlvhG/btsMC1KYIJW/AAAAAAAAAAAAAAAAAAAAAKfonzMl0nkvpYTBGSObpZuqbfb3pOFUvGOVjm0IypiX/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=JQKoSsjeXIETcop68cJZFcJNTmg%3D" alt="" height="297" width="568"><figcaption></figcaption></figure>

→ 문제 접속하면 뜨는 창

→ 코드를 해석해보면 id는 이미 guest로 고정 되어있고, no는 get방식으로 입력받는 것을 볼 수 있다.

⇒ 그런데 코드 후반부에 id를 보면 admin으로 받아야 goblin 해결 문구를 볼 수 있다는 것을 파악할 수 있다.

⇒ 따라서 id를 admin으로 변경해주는 쿼리문을 작성한다면 취약점을 뚫을 수 있다,

먼저 no = 1로 설정하고 접속을 하면

<figure><img src="https://blog.kakaocdn.net/dna/ccbJGJ/btsMBAOwQsH/AAAAAAAAAAAAAAAAAAAAANDnmkck34b1q2qNanYoRHdO4CosbcHraHH4XR8Cn3qY/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=%2BEHJ%2F3S9Yp4U0eZiqYUlyzLpUjQ%3D" alt="" height="492" width="688"><figcaption></figcaption></figure>

→ admin으로 접속된 게 아니라서 guest 관련 창이 뜨는 것을 볼 수 있다.

→ no = 1에는 guest 권한이 할당 된 것을 확인할 수 있다.

```
[도메인 값]no=3 or no=2
```

→ no=3은 false라서 저절로 무시되고,

→ no=2는 true라서 무조건 성립하는 것을 볼 수 있으며,

<figure><img src="https://blog.kakaocdn.net/dna/cz1qXr/btsMC57uTN5/AAAAAAAAAAAAAAAAAAAAACOkm_s7JbMvcsG-2zzkMRfiA3z7LZx0bjE9UuZclzvW/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=Z4cxsBajmAAQOuZoWHZ3yZ8sDfg%3D" alt="" height="455" width="710"><figcaption></figcaption></figure>

→ 클리어 창이 띄워지는 것을 볼 수 있다.


---

# 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/lord-of-sql-injection/lord-of-sqlinjection-goblin.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.
