Skip to content

Instantly share code, notes, and snippets.

@augieschwer
Last active August 29, 2015 14:06
Show Gist options
  • Save augieschwer/86749b68eea53b7dfe4b to your computer and use it in GitHub Desktop.
Save augieschwer/86749b68eea53b7dfe4b to your computer and use it in GitHub Desktop.
Manually update Bash to fix shellshock
# env x='() { :;}; echo VULNERABLE' /bin/bash -c "echo Running test. Check above for the word VULNERABLE."
cd /opt
mkdir src
cd src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
#download all patches
for i in $(seq -f "%03g" 0 25); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
tar zxvf bash-4.3.tar.gz
cd bash-4.3
#apply all patches
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
#build and install
./configure && make && make install
# if the included install script fails to install the new binary un-comment the following
#mv /bin/bash /bin/bash.old
#mv /opt/src/bash-4.3/bash /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment