> 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/de/web-vulnerabilities/deserialization-attack/php-deserialization-rce-pentesting-web.md).

# PHP-Deserialisierung RCE

## Deserialisierung (PHP)

Wir fanden eine Website, auf der man **Pings senden**:

<figure><img src="/files/73872c59930783c82f133fcc5a17873a17166b56" alt="" width="563"><figcaption></figcaption></figure>

Wir versuchten **verschiedene Eingaben zu testen**, aber nichts funktionierte:

<figure><img src="/files/fe46a1ed978586acccb659fd009d078aeee260e4" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/823fc1c60ad90caf619076ee69d642b6f17e6cb8" alt="" width="530"><figcaption></figcaption></figure>

Wir senden einen Ping an unsere **eigene Angreifer-IP-Adresse** und fangen die Anfrage mit [Burp](/de/hacking-tools/web/burpsuite.md):

<figure><img src="/files/bcb8a7af8ba854afb8da998e0ed770b72b227f64" alt="" width="563"><figcaption></figcaption></figure>

Wir sehen, dass es **serialisiert**:

<figure><img src="/files/b3dde02f5473e42d646b412d40d12846e8e00ab9" alt="" width="563"><figcaption></figcaption></figure>

Das **PHP** Der Code, mit dem wir es zu tun haben, ähnelt dem folgenden:

<figure><img src="/files/cc0f674ad3c73e405f78a4ef27df89945774365a" alt="" width="563"><figcaption></figcaption></figure>

Nach der Analyse des Codes stellen wir fest, dass das Ändern von **$isValid** zu `true` und das Einschleusen einer Reverse Shell in **ipAddress** nach einem **;** sollte die Ausführung von Befehlen auslösen:

<figure><img src="/files/aded65a0e064a183cbdfe213fd3247c5f80a670c" alt="" width="563"><figcaption></figcaption></figure>

Dann **serialisieren** die Datei erneut mit **PHP**:

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

<figure><img src="/files/fcfff2080c23a4289820a133267177b4f27f30b6" alt="" width="563"><figcaption></figcaption></figure>

Mit **Netcat**, lauschen wir auf Port **443** und erhalten die Shell:

<figure><img src="/files/d442b8c5a9d5f9cd3fd1731fe931e93cc9f89d56" alt="" width="563"><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/de/web-vulnerabilities/deserialization-attack/php-deserialization-rce-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.
