> 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/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-wfuzz-pentesting-web.md).

# SSRF Wfuzz

## Installation des ersten Szenarios (SSRF-Schwachstelle)

```bash
docker pull ubuntu:latest
docker run -dit --name ssrf_first_lab ubuntu
docker exec -it ssrf_first_lab bash
apt update
apt install apache2 php nano python3 lsof -y
service apache2 start
lsof -i:80 # verify that the website is active

```

* Im Verzeichnis **/var/www/html**, erstellen Sie eine Datei utility.php mit dem folgenden Inhalt:

```php
<?php
if (isset($_GET['url'])) {
    $url = $_GET['url'];
    echo "/n[+] Inhalt der Website " . $url . " auflisten:/n/n";
    include($url);
} else {
    echo "/n[!] Für den URL-Parameter wurde kein Wert angegeben/n/n";
}
?>

```

* In diesem Fall funktioniert das Skript nicht wie erwartet. Sie müssen die Datei ändern **"/etc/php/8.1/apache2/php.ini"** indem Sie \_allow/\_url/*include* auf "on". ![](/files/8837244a6e0a93143b09a4bf69a3ff802013d948) ![](/files/4f4cb71f7292a08d71ee81542693eb19fe72fc82)
* Erstellen Sie eine `login.html` Datei in `/tmp/` um eine produktive Login-Seite zu simulieren:

```html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Anmeldeseite </title>
<style>
Body {
  font-family: Calibri, Helvetica, sans-serif;
  background-color: pink;
}
button {
       background-color: #4CAF50;
       width: 100%;
        color: orange;
        padding: 15px;
        margin: 10px 0px;
        border: note;
        cursor: pointer;
         }
 form {
        border: 3px solid #f1f1f1;
    }
 input[type=text], input[type=password] {
        width: 100%;
        margin: 8px 0;
        padding: 12px 20px;
        display: inline-block;
        border: 2px solid green;
        box-sizing: border-box;
    }
 button:hover {
        opacity: 0.7;
    }
  .cancelbtn {
        width: auto;
        padding: 10px 18px;
        margin: 10px 5px;
    }
 .container {
        padding: 25px;
        background-color: lightblue;
    }
</style>
</head>
<body>
    <center> <h1> Studenten-Loginformular (PRO) </h1> </center>
    <form>
        <div class="container">
            <label>Benutzername: </label>
            <input type="text" placeholder="Benutzernamen eingeben" name="username" required>
            <label>Passwort: </label>
            <input type="password" placeholder="Passwort eingeben" name="password" required>
            <button type="submit">Anmelden</button>
            <input type="checkbox" checked="checked"> Angemeldet bleiben
            <button type="button" class="cancelbtn"> Abbrechen</button>
            Passwort vergessen? <a href="#"> </a>

    </form>
</body>
</html>

```

* Starten Sie den Dienst apache2 nach der Änderung neu:

  ```bash
  service apache2 restart

  ```
* Erstellen Sie einen Python3-Webserver, der nur vom internen Netzwerk aus sichtbar ist:

```bash
python3 -m 4646 --bind 127.0.0.1

```

Technisches Diagramm zum Verständnis des ersten Szenarios (**Es gibt eine Website auf Port 8089, die nur von den Computern des internen Netzwerks aus sichtbar ist**):

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

Dank des **utility.php** Skripts geben wir eine URL an und sehen, dass sie interpretiert wird:

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

Wenn wir versuchen, uns von unserem normalen Rechner aus zu verbinden, **haben wir keinen Zugriff** auf die Website:

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

Aber wenn wir uns über **utility.php** verbinden und die URL des internen Netzwerks angeben, sehen wir, dass sie sie interpretiert:

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

In einem hypothetischen Fall, in dem **wir den Port nicht kennen**, verwenden wir **Wfuzz** um einen Brute-Force-Angriff zu starten:

```go
wfuzz -c -t 200 -z range,1-65535 "http://172.17.0.2/utility.php?url=http://127.0.0.1:FUZZ"

```

<figure><img src="/files/0579703e1fa153713712f1bbdf8af27971300d1f" alt="" width="503"><figcaption></figcaption></figure>

Jetzt **filtern** um nur Websites mit einer anderen **4-Zeichen-Länge**:

```go
wfuzz -c -t 200 --hl=4  -z range,1-65535 "http://172.17.0.2/utility.php?url=http://127.0.0.1:FUZZ"

```

Es erkennt die Ports **80 und 4646**:

<figure><img src="/files/cc768d234f5209612001e32db788bea178b6053c" 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/owasp-top-10-vulnerabilities/vulnerability-server-side-request-forgery-ssrf/ssrf-wfuzz-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.
