From 09c2605f84598aea998a5d29f66dcdbafbcce087 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Tue, 16 Feb 2021 09:01:05 +0100 Subject: [PATCH] Simplify sg --- _gtfobins/sg.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/_gtfobins/sg.md b/_gtfobins/sg.md index 449c712..c0d1150 100644 --- a/_gtfobins/sg.md +++ b/_gtfobins/sg.md @@ -3,17 +3,8 @@ functions: shell: - description: Commands can be run if the current user's group is specified, therefore no additional permissions are needed. code: | - GROUPNAME=users - sg $GROUPNAME -c "/bin/sh" - command: - - description: Commands can be run if the current user's group is specified, therefore no additional permissions are needed. - code: | - COMMAND=whoami - GROUPNAME=users - sg $GROUPNAME -c $COMMAND + sg $(id -ng) sudo: - - description: Any group can be specified as the user will have root permissions. - code: | - GROUPNAME=users - sudo sg $GROUPNAME -c "/bin/sh" + - code: | + sudo sg root ---