# HCTF 2018

## Web

### admin

首先通过注册账号进行信息收集，可以在 `/change` 页面发现提示

```html
 <!-- https://github.com/woadsl1234/hctf_flask/ -->
```

通过关键词 flask 可以明白这题需要 SSTI 模板注入，接下来就是找注入口，但由于这个 Github 链接无法访问，通过在 Github 搜索可以发现别人的 [Fork](https://github.com/Wkh19/hctf_flask) 。

其中可以在 `routes.py` 文件中的可以发现以下函数

```python
def strlower(username):
    username = nodeprep.prepare(username)
    return username
```

该函数在注册时候调用，其中的`nodeprep.prepare()` 的作用则是将在 `register()` 函数中将 Unicode字符 `ᴬ` 转换成 `A` ，而 `A` 在 `change()` 函数中调用 `nodeprep.prepare()` 函数会把 `A` 转换成 `a` 。

因此我们使用 `ᴬdmin` 注册并登录后修改密码后退出登录后用修改后的密码登录 `admin` 即可得到 flag


---

# Agent Instructions: 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://writeup.owo.show/hctf-2018.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.
