Skip to content

Instantly share code, notes, and snippets.

@hunk
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save hunk/ba7e4d8b21e7e01311ab to your computer and use it in GitHub Desktop.

Select an option

Save hunk/ba7e4d8b21e7e01311ab to your computer and use it in GitHub Desktop.
#!/bin/sh
##############################################################
# This is the ShellShocker.net bash updater script.
# Version 1.0!
#
# Are you looking at this in your web browser, and would like to apply the bash patches?
# Just open up your terminal and type:
#
# curl https://shellshock.net/fixbash | sh
########
# REV 4: Added prefix to configure for fedora systems.
########
# This script will download bash 4.3 to your home directory, extract, download patches, patch,
# install patches, and install the fixed bash.
# - Mac: OS X
# - Linux: x86 and x86_64 systems
##############################################################
echo "----------------------------------------------"
echo "-- WELCOME TO THE SHELLSHOCKER BASH PATCHER --"
echo "----------------------------------------------"
echo "--- Revision 4, 092614-12:55PM ---"
echo "--- Provided by https://shellshocker.net/ ---"
echo "----------------------------------------------"
echo "Creating folders..."
cd ~/
mkdir bash-shellshocker
cd bash-shellshocker
echo "Downloading Bash..."
wget https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
echo "Downloading Bash patches..."
for i in $(seq -f "%03g" 0 25); do wget https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
echo "Extracting bash from tar.gz..."
tar zxvf bash-4.3.tar.gz
cd bash-4.3
echo "Applying Patches..."
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
echo "Ready to install. Configuring... You may need to type your sudo password here."
sudo ./configure --prefix=/
echo "Running make"
sudo make
echo "Running make install"
sudo make install
echo "----------------------------------------------"
echo "Done! Try opening a new bash shell and checking if your system is still vulnerable."
echo "Script provided by https://shellshocker.net/"
echo "Please go leave a comment and let me know if this script worked for you!"
echo "Follow us on twitter too, https://twitter.com/shellshockernet"
echo "-Thanks"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment