Skip to content

Instantly share code, notes, and snippets.

@fallwith
Created September 25, 2014 22:30
Show Gist options
  • Save fallwith/b2d51706747937cbf5ea to your computer and use it in GitHub Desktop.
Save fallwith/b2d51706747937cbf5ea to your computer and use it in GitHub Desktop.
Upgrade Bash from source in response to shellshock
#!/bin/sh
# build and install a fully patched bash 4.3 to mitigate shellshock
#
# to determine vulnerability:
# %> env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
mkdir bash_src
cd bash_src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
tar xzf bash-4.3.tar.gz
cd bash-4.3
for i in $(seq -f "%03g" 0 25); do
wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i
patch -p0 < bash43-$i
done
./configure && make && make install
cd ../..
rm -rf bash_src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment