Last active
August 29, 2015 14:06
-
-
Save yurrriq/569c1b296749baa5b2a5 to your computer and use it in GitHub Desktop.
Hackish Shellsock Bash Workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fix_it { | |
for i in $(seq 8); do echo; done | |
cd ~ && mkdir bash-fix && cd $_ | |
curl https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz | tar zxf - | |
cd bash-4.3 | |
for i in $(seq -f "%03g" 1 25); do | |
curl -s https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i | patch -p0 | |
done | |
./configure && make && make install && bash --version && rm -r bash-4.3 | |
} | |
VERSION=$(bash --version | head -n 1 | awk '{print $3" "$4}') \ | |
env EXPLOIT='() { :;}; echo Bash $VERSION is vulnerable!' \ | |
bash -c "EXPLOIT && echo 'Can we fix it? Yes, we can.'" \ | |
&& fix_it || echo 'Oh hayyy!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment