82 points · by ericclemmons · 12y ago · 54 comments
env X='() { (a)=>\' sh -c "echo date"; cat echo
calls sh rather than bash, which is likely not linked to bash on Debian-y systems.Furthermore, keep in mind http://thejh.net/misc/website-terminal-copy-paste and use C-x C-e.
curl https://shellshocker.net/fixbash | shAre you in doubt if your server is vulnerable? just create this simple bash CGI file, and then get it called by us!
Just in case your apache did not have any bash CGI as usual :)
What could possibly go wrong.
(I had a rubber stamp made up with this saying. It is part of my black bag.)
sh will run whatever is pointed by the symlink. It's a good idea to try that than relying on bash being in its place and that an attacher hasn't masked it. Apache and other daemons will run sh, so that's what you want to try.
Otherwise, I think it's just installed to $ac_default_prefix/bin, which is usually /usr/local/bin, leaving your old vulnerable one still in /bin/bash
./configure --prefix=/
http://seclists.org/oss-sec/2014/q3/741
http://seclists.org/oss-sec/2014/q3/711
Was that before the second patch was sent out last night?
Or can we expect a third patch this weekend?
I have issued an updated patcher script that fixes the patch: https://github.com/tpfister/public/blob/master/patch_shellsh...
The relevant changes are:
# aftershock patch CVE-2014-7169
wget -nv http://tomas.pfister.fi/aftershock_4.3.txt
patch -p0 < aftershock_4.3.txt
After patching the second vulnerability no longer works:
tp@tp:~/src/bash-4.3$ env X='() { (a)=>\' ./bash -c "echo date"; cat echo ./bash: X: line 1: syntax error near unexpected token `=' ./bash: X: line 1: `' ./bash: error importing function definition for `X' date cat: echo: No such file or directory tp@tp:~/src/bash-4.3$
I tried a knowned patched server and it gave me an unknown result.
Next I tried a known vulnerable server I don't have the authority to patch, and it said it timed out because my server didn't respond within 3 seconds.
Then it told me I had to wait 15 minutes to test that domain again.
0/2 when starting with known results, I wouldn't rely on this for anything you don't already know the status of.
That is to say, rather than
env X='() { (a)=>\' bash -c "echo date"; cat echo
just X='() { (a)=>\' bash -c "echo date"; cat echo
That is to say, the shell already has the "env" functionality built in: VAR1=value1 VAR2=value2 ... VARN=valuen command arg ...If you do have some gem that runs a system cmd, wouldn't it still require url input to get passed down to that command?
I'm not advocating NOT upgrading your systems, but still fuzzy on the attack vector if this test requires I upload a cgi script
Any protocol or service that runs via BASH is vulnerable. CGI is currently the largest and easiest attack vector to test for.
So, if your bash is ok, you're ok. But if your bash is bad, now it's a race to patch properly before someone else gets it.
Well, it does, and no amount of apt-get update / install bash is fixing it.
Is there a fix for this new issue?
Do we know when it's going to be available in the big distros?
They're working on getting a patch out. I'm disappointed with how Apple downplays the risk in their public statement. Some of the vectors for vulnerability are pretty insidious (e.g. the DHCP client vuln). Worth noting, it appears that OS X DHCP is not vulnerable to shellshock[1].
[1] http://complexitydaemon.wordpress.com/2014/09/26/bash-os-x-d...
Removed "This could mean that the server is not at all vulnerable" from the warning messages. Fixed the second exploit to be bash, not sh.
The two exploits you've posted:
1. env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
2. env X='() { (a)=>\' bash -c "echo date"; cat echo
The third variant Mitchell posted in his comment: 3. env -i X=' () { }; echo hello' bash -c 'date'
The systems I've tried these on both have been updated with "sudo apt-get update"; "sudo apt-get dist-upgrade".The systems are:
A. Ubuntu 12.04.5 LTS, running Bash version 4.2.25(1)-release (x86_64-pc-linux-gnu)
B. Ubuntu 10.04.4 LTS, running version 4.1.5(1)-release (x86_64-pc-linux-gnu)They should just leave the last part "We couldn't detect it as being vulnerable."
However, my load-balancer would still kill the request, I suspect.
(EDIT: Sorry.. my point being; your site should probably class 400's as 'safe'?)
/ianal
edit: Maybe Mattel will however :) http://trademarks.justia.com/857/91/shell-shocker-85791354.h...
Of course, determining where the line gets drawn probably isn't always a matter of checking off items in some checklist (gray areas, etc.). Nevertheless, in the case of Newegg's Shell Shocker deals, it doesn't seem to me like it overlaps with this site's intent (vulnerability testing). Only overlap I see is that it's something that's operated over the Internet. Would be far-fetched to say that this site is capitalizing on Newegg's brand goodwill to... get people to test for server/machine vulnerabilities.
Also... "It is not necessary for a trademark owner to take enforcement action against all infringement if it can be shown that the owner perceived the infringement to be minor and inconsequential. This is designed to prevent owners from continually being tied up in litigation for fear of cancellation."[1] So just because Newegg has a trademark doesn't mean it immediately and invariably has an obligation to enforce it at the threat of losing it.
[1] http://en.wikipedia.org/wiki/Trademark#Maintaining_rights