Skip to content

Instantly share code, notes, and snippets.

@aaudis
Last active August 29, 2015 14:06
Show Gist options
  • Save aaudis/100ad145937b6c4e002a to your computer and use it in GitHub Desktop.
Save aaudis/100ad145937b6c4e002a to your computer and use it in GitHub Desktop.
bash patch
# test: env x='() { :;}; echo vulnerable’ bash -c “echo this is a test”
# uz Mac OS X ShellShock patch
http://mac-how-to.wonderhowto.com/how-to/every-mac-is-vulnerable-shellshock-bash-exploit-heres-patch-os-x-0157606/
# Linux
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
cd ..
cd ..
rm -rf src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment