Skip to content

Instantly share code, notes, and snippets.

@srinivasmohan
Created September 25, 2014 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srinivasmohan/7509eac7e9cf7080a321 to your computer and use it in GitHub Desktop.
Save srinivasmohan/7509eac7e9cf7080a321 to your computer and use it in GitHub Desktop.
shellsock.sh
#!/bin/sh
#Patch bash for CVE-2014-6271 - For non-lts distro versions.
mkdir -p /usr/local/src && cd /usr/local/src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
tar zxvf bash-4.3.tar.gz
#Get patches
for i in $(seq -f "%03g" 0 25); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
cd bash-4.3
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
./configure && make && make install
cp -f /usr/local/bin/bash /bin/bash
#TEST post run: env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment