Skip to content

Instantly share code, notes, and snippets.

@JonRowe
Last active June 28, 2016 20:26
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JonRowe/8f128cbfca40d61547bc to your computer and use it in GitHub Desktop.
Save JonRowe/8f128cbfca40d61547bc to your computer and use it in GitHub Desktop.
Recompile bash to prevent ShellShock, see http://alblue.bandlem.com/2014/09/bash-remote-vulnerability.html
mkdir bash-fix
cd bash-fix
curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
cd bash-92/bash-3.2
curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-053 | patch -p0
cd ..
xcodebuild
sudo cp /bin/bash /bin/bash.old
sudo cp /bin/sh /bin/sh.old
build/Release/bash --version # GNU bash, version 3.2.53(1)-release
build/Release/sh --version # GNU bash, version 3.2.53(1)-release
sudo cp build/Release/bash /bin
sudo cp build/Release/sh /bin
@photostu
Copy link

photostu commented Oct 3, 2014

Thanks indeed, compiled and applied no sweat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment