Compile
- mkdir bash
- cd bash/
- wget http://opensource.apple.com/tarballs/bash/bash-92.tar.gz
- tar zxvf bash-92.tar.gz
- cd bash-92
- cd bash-3.2/
- curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
- curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-053 | patch -p0
- curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-054 | patch -p0
- cd ..
- xcodebuild
Verify
- /bin/bash --version
- ~/bash/bash-92/build/Release/bash --version
Install
sudo mv /bin/bash /bin/bash.vulnerablesudo cp /bin/bash /bin/bash.vulnerablesudo mv /bin/sh /bin/sh.vulnerablesudo cp /bin/sh /bin/sh.vulnerable- sudo chmod 0000 /bin/bash.vulnerable
- sudo chmod 0000 /bin/sh.vulnerable
- sudo cp ~/bash/bash-92/build/Release/bash /bin/
- sudo cp ~/bash/bash-92/build/Release/sh /bin/
- /bin/bash --version
- https://www.us-cert.gov/ncas/current-activity/2014/09/24/Bourne-Again-Shell-Bash-Remote-Code-Execution-Vulnerability
- http://www.theregister.co.uk/2014/09/24/bash_shell_vuln/
- https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/
- https://access.redhat.com/articles/1200223
- http://alblue.bandlem.com/2014/09/bash-remote-vulnerability.html
- http://support.apple.com/kb/HT1222
- http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00085.html
- http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00228.html
- http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00282.html