From ca91885fcee9234206c46f0abcefaf4bc02350fc Mon Sep 17 00:00:00 2001 From: Dov Murik Date: Wed, 30 May 2018 07:56:12 +0000 Subject: [PATCH 1/5] Add nl --- _gtfobins/nl.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 _gtfobins/nl.md diff --git a/_gtfobins/nl.md b/_gtfobins/nl.md new file mode 100644 index 0000000..99878a1 --- /dev/null +++ b/_gtfobins/nl.md @@ -0,0 +1,5 @@ +--- +functions: + file-read: + - code: nl -bn -w1 file_to_read +--- From d1906b7fdd8047b940bf817e5aadf88a84c4c530 Mon Sep 17 00:00:00 2001 From: Dov Murik Date: Wed, 30 May 2018 08:17:06 +0000 Subject: [PATCH 2/5] Add unshare --- _gtfobins/unshare.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 _gtfobins/unshare.md diff --git a/_gtfobins/unshare.md b/_gtfobins/unshare.md new file mode 100644 index 0000000..756aff2 --- /dev/null +++ b/_gtfobins/unshare.md @@ -0,0 +1,12 @@ +--- +functions: + execute-interactive: + - code: unshare /bin/sh + sudo-enabled: + - code: sudo unshare /bin/sh + suid-enabled: + - description: This keeps the SUID privileges only if the `-r` option is present. + code: ./unshare -r /bin/sh + suid-limited: + - code: ./unshare /bin/sh +--- From fa60f30f5aa89b05406ca80bbe75a5e808952fe0 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Wed, 30 May 2018 12:26:29 +0200 Subject: [PATCH 3/5] Remove suid-limited as it is superseded by suid-enabled --- _gtfobins/unshare.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/_gtfobins/unshare.md b/_gtfobins/unshare.md index 756aff2..412774b 100644 --- a/_gtfobins/unshare.md +++ b/_gtfobins/unshare.md @@ -5,8 +5,5 @@ functions: sudo-enabled: - code: sudo unshare /bin/sh suid-enabled: - - description: This keeps the SUID privileges only if the `-r` option is present. - code: ./unshare -r /bin/sh - suid-limited: - - code: ./unshare /bin/sh + - code: ./unshare -r /bin/sh --- From 4c3c73a4b6f076f47baa6edbe2152fd64324ecd2 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Wed, 30 May 2018 12:45:42 +0200 Subject: [PATCH 4/5] Add variables to nl --- _gtfobins/nl.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_gtfobins/nl.md b/_gtfobins/nl.md index 99878a1..d2d0e5d 100644 --- a/_gtfobins/nl.md +++ b/_gtfobins/nl.md @@ -1,5 +1,7 @@ --- functions: file-read: - - code: nl -bn -w1 file_to_read + - code: | + LFILE=file_to_read + nl -bn -w1 $LFILE --- From ab481fa4a558e8c0db509119d9fc4991108335e8 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Wed, 30 May 2018 12:46:51 +0200 Subject: [PATCH 5/5] Reduce the number of leading spaces in nl and comment about it --- _gtfobins/nl.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_gtfobins/nl.md b/_gtfobins/nl.md index d2d0e5d..d886971 100644 --- a/_gtfobins/nl.md +++ b/_gtfobins/nl.md @@ -1,7 +1,8 @@ --- functions: file-read: - - code: | + - description: This prepends a leading space to each line. + code: | LFILE=file_to_read - nl -bn -w1 $LFILE + nl -bn -w1 -s '' $LFILE ---