From 513909c38c62d6f286e8144438bd3025ed767337 Mon Sep 17 00:00:00 2001 From: Michalis Papadopoullos Date: Mon, 11 Jan 2021 13:59:30 +0200 Subject: [PATCH 1/6] Added adiff, ar, bridge file_read --- _gtfobins/adiff.md | 11 +++++++++++ _gtfobins/ar.md | 9 +++++++++ _gtfobins/bridge.md | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 _gtfobins/adiff.md create mode 100644 _gtfobins/ar.md create mode 100644 _gtfobins/bridge.md diff --git a/_gtfobins/adiff.md b/_gtfobins/adiff.md new file mode 100644 index 0000000..e018484 --- /dev/null +++ b/_gtfobins/adiff.md @@ -0,0 +1,11 @@ +--- +functions: + file-read: + - description: Read files from archives when utils like "tar" are missing. + code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ar r "${OUTFILE}" "${LFILE}" + adiff "${OUTFILE}" /dev/null + ls -la Unpack* +--- diff --git a/_gtfobins/ar.md b/_gtfobins/ar.md new file mode 100644 index 0000000..1a72b35 --- /dev/null +++ b/_gtfobins/ar.md @@ -0,0 +1,9 @@ +--- +functions: + file-read: + code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ar r "${OUTFILE}" "${LFILE}" + cat "${OUTFILE}" +--- diff --git a/_gtfobins/bridge.md b/_gtfobins/bridge.md new file mode 100644 index 0000000..f3ce889 --- /dev/null +++ b/_gtfobins/bridge.md @@ -0,0 +1,8 @@ +--- +functions: + file-read: + - description: Outputs the first line of the file, until the first whitespace, to stderr. + code: | + LFILE=file_to_read + bridge -b "${LFILE}" +--- From 629501ccc7e6a508a18ef75668b0ad3c6e2e8e7d Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 17 Jan 2021 23:22:33 +0100 Subject: [PATCH 2/6] Improve bridge --- _gtfobins/bridge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_gtfobins/bridge.md b/_gtfobins/bridge.md index f3ce889..db0bbe7 100644 --- a/_gtfobins/bridge.md +++ b/_gtfobins/bridge.md @@ -1,8 +1,8 @@ --- functions: file-read: - - description: Outputs the first line of the file, until the first whitespace, to stderr. + - description: Outputs the first line of the file (until the first whitespace) inside an error message to stdandard error. code: | LFILE=file_to_read - bridge -b "${LFILE}" + bridge -b "$LFILE" --- From f7ff2ea85267803a4ce66fbbc5ce9387f69d5788 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 17 Jan 2021 23:25:31 +0100 Subject: [PATCH 3/6] Add suid and sudo to bridge --- _gtfobins/bridge.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/_gtfobins/bridge.md b/_gtfobins/bridge.md index db0bbe7..59edeea 100644 --- a/_gtfobins/bridge.md +++ b/_gtfobins/bridge.md @@ -1,8 +1,16 @@ --- +description: Outputs the first line of the file (until the first whitespace) inside an error message to stdandard error. functions: file-read: - - description: Outputs the first line of the file (until the first whitespace) inside an error message to stdandard error. - code: | + - code: | LFILE=file_to_read bridge -b "$LFILE" + suid: + - code: | + LFILE=file_to_read + ./bridge -b "$LFILE" + sudo: + - code: | + LFILE=file_to_read + sudo bridge -b "$LFILE" --- From bed198068fb47c7626018b3b6c4cb2371145f07c Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 17 Jan 2021 23:32:44 +0100 Subject: [PATCH 4/6] Fix ar and add suid and sudo --- _gtfobins/ar.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/_gtfobins/ar.md b/_gtfobins/ar.md index 1a72b35..2e8e300 100644 --- a/_gtfobins/ar.md +++ b/_gtfobins/ar.md @@ -1,9 +1,22 @@ --- +description: The file appears amid the binary content of the archive. functions: file-read: - code: | - OUTFILE=$(mktemp -u) - LFILE=file_to_read - ar r "${OUTFILE}" "${LFILE}" - cat "${OUTFILE}" + code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" + suid: + code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ./ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" + sudo: + code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + sudo ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" --- From 7da862726207fff338a930abc8a7971efd7975ff Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 17 Jan 2021 23:38:07 +0100 Subject: [PATCH 5/6] Remove adiff since is ar that actually reads here --- _gtfobins/adiff.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 _gtfobins/adiff.md diff --git a/_gtfobins/adiff.md b/_gtfobins/adiff.md deleted file mode 100644 index e018484..0000000 --- a/_gtfobins/adiff.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -functions: - file-read: - - description: Read files from archives when utils like "tar" are missing. - code: | - OUTFILE=$(mktemp -u) - LFILE=file_to_read - ar r "${OUTFILE}" "${LFILE}" - adiff "${OUTFILE}" /dev/null - ls -la Unpack* ---- From 0d5c4572331467dbafd576779f3c618dbb7b1e91 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 17 Jan 2021 23:40:41 +0100 Subject: [PATCH 6/6] Fix YAML in ar --- _gtfobins/ar.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/_gtfobins/ar.md b/_gtfobins/ar.md index 2e8e300..9b0f36f 100644 --- a/_gtfobins/ar.md +++ b/_gtfobins/ar.md @@ -2,21 +2,21 @@ description: The file appears amid the binary content of the archive. functions: file-read: - code: | - OUTFILE=$(mktemp -u) - LFILE=file_to_read - ar r "$OUTFILE" "$LFILE" - cat "$OUTFILE" + - code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" suid: - code: | - OUTFILE=$(mktemp -u) - LFILE=file_to_read - ./ar r "$OUTFILE" "$LFILE" - cat "$OUTFILE" + - code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + ./ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" sudo: - code: | - OUTFILE=$(mktemp -u) - LFILE=file_to_read - sudo ar r "$OUTFILE" "$LFILE" - cat "$OUTFILE" + - code: | + OUTFILE=$(mktemp -u) + LFILE=file_to_read + sudo ar r "$OUTFILE" "$LFILE" + cat "$OUTFILE" ---