From c80e83c3c59ca6734c40476ddf1415a041d340ae Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 20 Dec 2020 21:23:28 +0100 Subject: [PATCH] Make install similar to chmod --- _gtfobins/chmod.md | 6 +++--- _gtfobins/install.md | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/_gtfobins/chmod.md b/_gtfobins/chmod.md index 61e3361..0fc3dde 100644 --- a/_gtfobins/chmod.md +++ b/_gtfobins/chmod.md @@ -1,12 +1,12 @@ --- -description: This can be run with elevated privileges to change permissions and then read, write, or execute a file. +description: This can be run with elevated privileges to change permissions (`6` denotes the SUID bits) and then read, write, or execute a file. functions: suid: - code: | LFILE=file_to_change - ./chmod 0777 $LFILE + ./chmod 6777 $LFILE sudo: - code: | LFILE=file_to_change - sudo chmod 0777 $LFILE + sudo chmod 6777 $LFILE --- diff --git a/_gtfobins/install.md b/_gtfobins/install.md index 9fad402..a10c425 100644 --- a/_gtfobins/install.md +++ b/_gtfobins/install.md @@ -1,13 +1,14 @@ --- +description: This can be run with elevated privileges to change permissions (`6` denotes the SUID bits) and then read, write, or execute a copy of the file. functions: suid: - code: | + LFILE=file_to_change TF=$(mktemp) - install -m 4755 `which sh` $TF - $TF -p + ./install -m 6777 $LFILE $TF sudo: - code: | + LFILE=file_to_change TF=$(mktemp) - sudo install -m 4755 `which sh` $TF - $TF -p + sudo install -m 6777 $LFILE $TF ---