---
description: >-
  A tutorial room exploring CVE-2021-3156 in the Unix Sudo Program. Room Three
  in the SudoVulns Series
---

# Baron Samedit: CVE-2021-3156

{% embed url="https://tryhackme.com/room/sudovulnssamedit" %}
[https://tryhackme.com/room/sudovulnssamedit](https://tryhackme.com/room/sudovulnssamedit)
{% endembed %}

| Room Attributes       | Value                                                                   |
| --------------------- | ----------------------------------------------------------------------- |
| Subscription Required |  <mark style="color:green;background-color:green;">False</mark> \[Free] |
| Type                  | Walkthrough                                                             |
| Difficulty            |  <mark style="color:blue;background-color:blue;">Info</mark>            |
| Tags                  | SudoVulns, CVE-2021-3156, Sudo, Beginner                                |

## Video Walkthrough

{% embed url="https://youtu.be/qkA_YD5K4nI" %}
TryHackMe Baron Samedit Official Walkthrough
{% endembed %}

## Task 1 - Deploy!

### Deployed!

{% hint style="success" %}
No answer needed
{% endhint %}

## Task 2 - Baron Samedit

### After compiling the exploit, what is the name of the executable created (blurred in the screenshots above)?

<details>

<summary>Reveal Flag <span data-gb-custom-inline data-tag="emoji" data-code="1f6a9">🚩</span></summary>

:triangular\_flag\_on\_post:`sudo-hax-me-a-sandwich`

</details>

### Run the exploit! You should now have a root shell -- what is the flag in `/root/flag.txt`?

<details>

<summary>Reveal Flag <span data-gb-custom-inline data-tag="emoji" data-code="1f6a9">🚩</span></summary>

:triangular\_flag\_on\_post:`THM{NmU4OWYwMWJmMjkxMDdiYTU4MWIxNWVk}`

</details>

