Files
PEASS-ng/linPEAS/builder/linpeas_parts/functions/su_try_pwd.sh
T
npcandGitHub 10b087febf Fix su bruteforce false positives on BusyBox systems (bbsuid)
Fix su bruteforce false positives on BusyBox systems (bbsuid)
2025-12-15 20:23:52 +08:00

24 lines
618 B
Bash

# Title: LinPeasBase - su_try_pwd
# ID: su_try_pwd
# Author: Carlos Polop
# Last Update: 15-12-2025
# Description: Try to login as user using a password
# License: GNU GPL
# Version: 1.0
# Functions Used:
# Global Variables: $SED_RED_YELLOW
# Initial Functions:
# Generated Global Variables: $BFUSER, $PASSWORDTRY, $trysu
# Fat linpeas: 0
# Small linpeas: 1
su_try_pwd(){
BFUSER=$1
PASSWORDTRY=$2
trysu=$(echo "$PASSWORDTRY" | timeout 1 su $BFUSER -c whoami 2>/dev/null)
if [ $? -eq 0 ]; then
echo " You can login as $BFUSER using password: $PASSWORDTRY" | sed -${E} "s,.*,${SED_RED_YELLOW},"
fi
}