From 37a2030faf79ca1f7ea6f7a82eae43b86c4b58ab Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 27 Jan 2021 11:27:44 +0000 Subject: [PATCH] Fix: False positive for writeable network-scripts directory Symbolic links almost always have 777 permissions although this doesn't mean you can change them. This commit prevents the tool from flagging symbolic links with write access in the /etc/sysconfig/network-scripts folder --- linPEAS/linpeas.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linPEAS/linpeas.sh b/linPEAS/linpeas.sh index 3f8662f..ce2f172 100755 --- a/linPEAS/linpeas.sh +++ b/linPEAS/linpeas.sh @@ -2749,7 +2749,7 @@ if [ "`echo $CHECKS | grep IntFiles`" ]; then ##-- IF) network-scripts printf $Y"[+] "$GREEN"Can I write in network-scripts? ...... "$NC if [ -w "/etc/sysconfig/network-scripts/" ]; then echo "You have write privileges on /etc/sysconfig/network-scripts/" | sed -${E} "s,.*,${C}[1;31;103m&${C}[0m," - elif [ "`find /etc/sysconfig/network-scripts/ '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')' 2>/dev/null`" ]; then echo "You have write privileges on `find /etc/sysconfig/network-scripts/ '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')' 2>/dev/null`" | sed -${E} "s,.*,${C}[1;31;103m&${C}[0m," + elif [ "`find /etc/sysconfig/network-scripts/ '(' -not -type l -and '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')' ')' 2>/dev/null`" ]; then echo "You have write privileges on `find /etc/sysconfig/network-scripts/ '(' -not -type l -and '(' '(' -user $USER ')' -or '(' -perm -o=w ')' -or '(' -perm -g=w -and '(' $wgroups ')' ')' ')' ')' 2>/dev/null`" | sed -${E} "s,.*,${C}[1;31;103m&${C}[0m," else echo_no fi