From 2e55528e82f9c174c2a1de4a9422fcf46f828a53 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sat, 21 Mar 2020 19:24:30 +0100 Subject: [PATCH] Add cp file-write Along the lines of #122. --- _gtfobins/cp.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/_gtfobins/cp.md b/_gtfobins/cp.md index 420dccc..cc22864 100644 --- a/_gtfobins/cp.md +++ b/_gtfobins/cp.md @@ -4,7 +4,14 @@ functions: - code: | LFILE=file_to_read cp "$LFILE" /dev/stdout + file-write: + - code: | + LFILE=file_to_write + echo "DATA" | cp /dev/stdin "$LFILE" suid: + - code: | + LFILE=file_to_write + echo "DATA" | ./cp /dev/stdin "$LFILE" - description: This can be used to copy and then read or write files from a restricted file systems or with elevated privileges. code: | LFILE=file_to_write @@ -12,6 +19,9 @@ functions: echo "DATA" > $TF ./cp $TF $LFILE sudo: + - code: | + LFILE=file_to_write + echo "DATA" | sudo cp /dev/stdin "$LFILE" - description: This can be used to copy and then read or write files from a restricted file systems or with elevated privileges. code: | LFILE=file_to_write