Created
September 26, 2014 00:50
-
-
Save thom-nic/db60c2f192bbf311f959 to your computer and use it in GitHub Desktop.
Mac bash upgrade to mitigate the Shellshock exploit
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
# shellshock upgrade & patch for Mac OSX | |
# OSX ships with a horribly old version of bash (3.2) which is vulnerable to | |
# the Shellshock exploit (CVE-2014-6271) | |
# We use homebrew to get a recent version of bash, then symlink it to | |
# /bin/bash and /bin/sh (because sh is really bash) | |
# | |
# Use this to see if you're vulnerable | |
# env X="() { :;} ; echo vulnerable" /bin/bash -c "echo testing" | |
brew update && brew install bash | |
cd /bin | |
sudo mv bash bash.old | |
sudo ln -s /usr/local/bin/bash | |
sudo mv sh sh.old | |
sudo cp bash sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you already have bash installed via homebrew, just
brew update && brew upgrade bash