> For the complete documentation index, see [llms.txt](https://morgan-bin-bash.gitbook.io/linux-privilege-escalation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://morgan-bin-bash.gitbook.io/linux-privilege-escalation/sudo-screen-privilege-escalation.md).

# Sudo Screen Privilege Escalation

Sudo screen command might be vulnerable to privilege escalation (PrivEsc)

.

### [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.
