Skip to content

Instantly share code, notes, and snippets.

@drbraden
Last active August 29, 2015 14:06
Show Gist options
  • Save drbraden/2bdb8092760e850a7f49 to your computer and use it in GitHub Desktop.
Save drbraden/2bdb8092760e850a7f49 to your computer and use it in GitHub Desktop.
Upgrade bash on Debian Lenny (5.0), and other older systems
#
# Method of upgrading bash on Debian 5.0, in order to fix
# the vulnerability "shellshock", officially known as:
#
# CVE-2014-6271
# CVE-2014-7169
#
# The credit for this belongs to user "cft" on Hacker News,
# for upgrading Ubuntu 8.04: https://news.ycombinator.com/item?id=8371438
#
# It worked for me, but no warranties, express or implied.
#
# While this should also work for Debian 6 (Squeeze), there is an LTS apt
# repository providing security updates until February, 2016. Instructions
# for using LTS can be found at https://wiki.debian.org/LTS
#
#assume that your sources are in /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 27); 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 27);do patch -p0 < ../bash43-$i; done
#build and install
./configure && make && sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment