What seems to be wrong with my code below? I'm downloading and patching up to patch 18 which I understand is the patch for shellchock vulnerability. But I still get the vulnerability when running Bash.
Download source and patches
wget http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
wget http://ftp.gnu.org/gnu/bash/bash-3.1-patches/bash31-00{1..9} http://ftp.gnu.org/gnu/bash/bash-3.1-patches/bash31-0{10..18}
Unpack and apply patches
tar -xvf bash-3.1.tar.gz
cd bash-3.1
find ../bash31-??? -exec /bin/sh -c 'patch -p0 <{}' \;
(Asside: the find command above just happens to return a sorted list because of shell globbing, but I know this is not always true for the find find)
Config, Make, Make Install
./configure --prefix /tmp/bash_patched && make && make install
Run bash
/tmp/bash_patched/bin/bash
The following should return /tmp/bash_patched/bin/bash 3.1.18(1)-release
echo $BASH $BASH_VERSION
Do the shellshock test
env X="() { :;} ; echo busted" /bin/sh -c "echo stuff"
For me this returns
busted
stuff