From 64458b5947ae80f7cea6996de825dec205311e66 Mon Sep 17 00:00:00 2001 From: carlospolop Date: Wed, 29 Dec 2021 08:26:13 -0500 Subject: [PATCH] checks --- .../linpeas_parts/1_system_information.sh | 25 +++++++++++++++++++ linPEAS/builder/linpeas_parts/2_container.sh | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/linPEAS/builder/linpeas_parts/1_system_information.sh b/linPEAS/builder/linpeas_parts/1_system_information.sh index 1216858..4fd937d 100644 --- a/linPEAS/builder/linpeas_parts/1_system_information.sh +++ b/linPEAS/builder/linpeas_parts/1_system_information.sh @@ -69,6 +69,31 @@ if [ "$EXTRA_CHECKS" ]; then echo "" fi +if [ -d "/dev" ] || [ "$DEBUG" ] ; then + print_2title "Any sd*/disk* disk in /dev? (limit 20)" + ls /dev 2>/dev/null | grep -Ei "^sd|^disk" | sed "s,crypt,${SED_RED}," | head -n 20 + echo "" +fi + +if [ -f "/etc/fstab" ] || [ "$DEBUG" ]; then + print_2title "Unmounted file-system?" + print_info "Check if you can mount umounted devices" + grep -v "^#" /etc/fstab 2>/dev/null | grep -Ev "\W+\#|^#" | sed -${E} "s,$mountG,${SED_GREEN},g" | sed -${E} "s,$notmounted,${SED_RED}," | sed -${E} "s,$mounted,${SED_BLUE}," | sed -${E} "s,$Wfolders,${SED_RED}," | sed -${E} "s,$mountpermsB,${SED_RED},g" | sed -${E} "s,$mountpermsG,${SED_GREEN},g" + echo "" +fi + +if ([ "$(command -v diskutil)" ] || [ "$DEBUG" ]) && [ "$EXTRA_CHECKS" ]; then + print_2title "Mounted disks information" + warn_exec diskutil list + echo "" +fi + +if [ "$(command -v smbutil)" ] || [ "$DEBUG" ]; then + print_2title "Mounted SMB Shares" + warn_exec smbutil statshares -a + echo "" +fi + #-- SY) Environment vars print_2title "Environment" print_info "Any private information inside environment variables?" diff --git a/linPEAS/builder/linpeas_parts/2_container.sh b/linPEAS/builder/linpeas_parts/2_container.sh index c6ea9a6..f7cfd08 100644 --- a/linPEAS/builder/linpeas_parts/2_container.sh +++ b/linPEAS/builder/linpeas_parts/2_container.sh @@ -228,7 +228,7 @@ if [ "$inContainer" ]; then echo "" print_2title "Interesting Files Mounted" - (mount -l || cat /proc/self/mountinfo || cat /proc/1/mountinfo || cat /proc/mounts || cat /proc/self/mounts || cat /proc/1/mounts )2>/dev/null | grep -Ev "$GREP_IGNORE_MOUNTS" + (mount -l || cat /proc/self/mountinfo || cat /proc/1/mountinfo || cat /proc/mounts || cat /proc/self/mounts || cat /proc/1/mounts )2>/dev/null | grep -Ev "$GREP_IGNORE_MOUNTS" | sed -${E} "s,docker.sock,${SED_RED_YELLOW}," echo "" print_2title "Possible Entrypoints"