# Sudo Screen Privilege Escalation

.

### [Investigation](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-screen-privilege-escalation/#investigation) <a href="#investigation" id="investigation"></a>

```sh
sudo -l

(root) /usr/bin/screen -r testsession
Copied!
```

If we can execute **"screen"** command as root, we can spawn a root shell from the screen session.

<br>

### [Exploitation](https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-screen-privilege-escalation/#exploitation) <a href="#exploitation" id="exploitation"></a>

First execute **"screen"** command as root, then a screen session will be start.\
Now we can spawn a root shell by pressing **“Ctrl+a+c”** in the screen session.


---

# Agent Instructions: 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:

```
GET https://morgan-bin-bash.gitbook.io/linux-privilege-escalation/sudo-screen-privilege-escalation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
