Shellshock - Remote code execution via Bash
-
Not sure if this has been posted as my unread list on shows a few items even though it has 20+ in the icon (@psychobunny @julian @baris ??)
I'm not sure if many of you are aware but there has been a serious vulnerability found with Bash that will execute commands on a server via anything that uses system calls.
Everyone should update Bash as soon as possible. The recent patch is not a full patch for this vulnerability but it will help.
-
For those running Ubuntu:
Test if vulnerable:
$ env var='() { ignore this;}; echo uhoh' bash -c /bin/true
If you get a response of
uhoh
you're vulnerable.Here's the steps to patch:
apt-get update
apt-get install bash
$ env var='() { ignore this;}; echo uhoh' bash -c /bin/true
(Retest)You should now get something along the lines of:
bash: warning: var: ignoring function definition attempt bash: error importing function definition for 'var'
Patch success.
-
@Ted said:
Thanks to @a_5mith, I just binged several of his videos. He does a good job of breaking things down for those with little experience, when he isn't doing something humorous. Thanks for sharing this.
He does a few videos for Computerphile as well. Where he goes into a little more detail. Does some really good videos.
-
@julian alternatively recompile Bash by hand. This should work:
mkdir 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 28); 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 28);do patch -p0 < ../bash43-$i; done #build and install ./configure && make && make install cd .. cd .. rm -r src
Please note thought that a full patch for the exploit is not yet available.
-
@julian I am on Ubuntu 12 LTS and received the updates for bash. They may not have been out at the time you checked for 13?
I checked my logs and we only had a couple of attempts against our server, luckily I had updated when the quick fix got released and updated again when the actual fix was released.
-