#!
/bin/sh
##############################################################
# This is the [Link] bash updater script.
# Version 1.2!
#
# 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 [Link] | sh
########
# REV 4: Added prefix to configure for fedora systems.
# REV 5: Bumped patch to 26 from 25.
# REV 6: Bumped patch to 27 from 26.
# REV 7: Not using sudo when logged in as root:
[Link]
# REV 8: Updated loops to download and apply up to latest patch:
[Link]
# REV 9: Added check for gcc to be installed.
########
# 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 8, 092914-4:56PM ETC ---"
echo "--- Provided by [Link] ---"
echo "----------------------------------------------"
GCC=`which gcc`
PATCH=`which patch`
MAKE=`which make`
if [ -z "$GCC" ]; then
echo "Your system does not have the GNU gcc complier installed."
echo "Please install the gcc complier and then run this script again."
exit 1
fi
if [ -z "$PATCH" ]; then
echo "Your system does not have the GNU patch tool installed."
echo "Please install the patch tool and then run this script again."
exit 1
fi
if [ -z "$MAKE" ]; then
echo "Your system does not have the GNU make tool installed."
echo "Please install the make tool and then run this script again."
exit 1
fi
echo "Creating folders..."
cd ~/
mkdir bash-shellshocker
cd bash-shellshocker
echo "Downloading Bash..."
wget -N [Link]
echo "Downloading Bash patches..."
i=0
while [ true ]; do i=`expr $i + 1`; wget -N [Link]
patches/bash43-$(printf '%03g' $i); if [ $? -ne 0 ]; then break; fi; done
echo "Extracting bash from [Link]..."
tar zxvf [Link]
cd bash-4.3
echo "Applying Patches..."
for p in ../bash43-[0-9][0-9][0-9]; do patch -p0 < $p; done
echo "Ready to install. Configuring..."
./configure --prefix=/usr/local
echo "Running make"
make
if [ `id -u` -eq 0 ]
then
echo "Running make install"
make install
cp -f /usr/local/bin/bash /bin/bash
else
echo "Running make install (You may need to type your sudo password here)"
sudo make install
sudo cp -f /usr/local/bin/bash /bin/bash
fi
echo "----------------------------------------------"
curl --silent [Link] | bash
echo "Script provided by [Link]
echo "Please go leave a comment and let us know if this script worked for you!"
echo "Follow us on twitter too, [Link]
echo "Send issue requests to [Link]
echo "Want to help make shellshocker better? Contribute @
[Link]
echo "-Thanks"