From 2f791068e3b763a56395d126605443e88d91de84 Mon Sep 17 00:00:00 2001 From: James Hogan <5aru@users.noreply.github.com> Date: Sun, 21 Jan 2018 00:57:32 -0500 Subject: [PATCH 1/2] Forgot to add a check for user specific user permissions --- linuxprivchecker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linuxprivchecker.sh b/linuxprivchecker.sh index 244ef43..73e2fed 100755 --- a/linuxprivchecker.sh +++ b/linuxprivchecker.sh @@ -128,6 +128,9 @@ formatCommand "cat /etc/sudoers 2>/dev/null | grep -v '#' 2>/dev/null" echo -e "\n[+] Sudoers Files (Privileged) [/etc/sudoers.d/*]" formatCommand "cat /etc/sudoers.d/* 2>/dev/null | grep -v '#' 2>/dev/null" +echo -e "\n[+] User's specific sudo permissions" +formatCommand "sudo -l" + echo -e "\n[+] Logged in User Activity" formatCommand "w 2>/dev/null" From a7ecd2278312f893bb0bbefdf2e9eac26357aca5 Mon Sep 17 00:00:00 2001 From: James Hogan <5aru@users.noreply.github.com> Date: Sun, 21 Jan 2018 01:15:37 -0500 Subject: [PATCH 2/2] sudo -l will hang and wait for the user to input a password if there is not a user specific NOPASSWD entry available in the sudoers files. By adding the -n parameter, we force the command to be non-interactive. --- linuxprivchecker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linuxprivchecker.sh b/linuxprivchecker.sh index 73e2fed..b9e605e 100755 --- a/linuxprivchecker.sh +++ b/linuxprivchecker.sh @@ -128,8 +128,8 @@ formatCommand "cat /etc/sudoers 2>/dev/null | grep -v '#' 2>/dev/null" echo -e "\n[+] Sudoers Files (Privileged) [/etc/sudoers.d/*]" formatCommand "cat /etc/sudoers.d/* 2>/dev/null | grep -v '#' 2>/dev/null" -echo -e "\n[+] User's specific sudo permissions" -formatCommand "sudo -l" +echo -e "\n[+] User's specific NOPASSWD sudo entries" +formatCommand "sudo -ln" echo -e "\n[+] Logged in User Activity" formatCommand "w 2>/dev/null"