Last active
August 29, 2015 14:06
-
-
Save martinseener/99bd94e66b4296f2ae68 to your computer and use it in GitHub Desktop.
Shellshock Bash Patcher for Debian/Ubuntu (Rundeck-compatible)
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
#!/bin/bash | |
env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | grep vulnerable > /dev/null 2>&1 | |
if [ $? -eq 1 ]; then | |
echo "Not vulnerable. Machine is safe." | |
exit 0 | |
else | |
echo -n "Vulnerable. Version: " | |
/bin/bash --version | |
echo "Installing patch." | |
sudo apt-get update && sudo apt-get install bash | |
if [ $? -eq 0 ]; then | |
echo -n "Patching complete: " | |
/bin/bash --version | |
exit 0 | |
else | |
echo "Error updating bash binary. Please check it manually!!" | |
exit 1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use with Rundeck?