• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

"Shellshock" vulnerability (Bash command related - affects Linux/OSX) in the news

Status
Not open for further replies.

Jezbollah

Member
To all Sysadmins out there, please make note of this vulnerability (CVE-2014-6271)

A large number of programs on Linux and other UNIX systems use Bash to setup environmental variables which are then used while executing other programs. Examples of this include Web servers running CGI scripts and even email clients and web clients that pass files to external programs for display such as a video file or a sound file.

In short this vulnerability allows attackers to cause arbitrary command execution, remotely, for example by setting headers in a web request, or by setting weird mime types for example.

To test if your system is vulnerable just try this on bash:

env x='() { :;}; echo vulnerable’ bash -c “echo this is a test”

If you’re vulnerable it’ll print:

vulnerable
this is a test

If you’ve updated Bash you’ll only see

this is a test

For more information:

https://blog.cloudsecurityalliance.org/2014/09/24/worse-than-heartbleed/
https://securityblog.redhat.com/201...-environment-variables-code-injection-attack/
http://www.theregister.co.uk/2014/09/24/bash_shell_vuln/
http://www.bbc.com/news/technology-29361794

Hope this is useful to anyone out there.



UPDATE: - Thanks to those who posted the links below:


You need to fix up the double quotes, somewhere 'smart quotes' mangled them.

Code:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"



 

shuri

Banned
This is pretty goddamn dramatic, but it seems that if I understand well, it can only REALLY work _remotely_ when used on sites using cgi scripts that invokes bash.

my linux shell is only running irssi, so I guess i'm pretty safe.

edit: wait no, this affects openssh too; but i dont think that anyone could remotely run this as some sort of argument in a ssh connection query?

edit2: it affects everything. SHUT DOWN EVERYTHINNNNG
 

NekoFever

Member
Funny how this isn't getting nearly as much press as Heartbleed when it's potentially much worse.

Heartbleed allowed someone to grab a random snippet of data from a system, but only ones running OpenSSL and, of those, only ones running versions released in a window of a couple of years. Something like 500,000 systems total.

This allows an attacker to do anything on an affected system, and it affects any Linux or UNIX system running any version of bash from the last 25 years, which is basically all of them. That's more than half of all web servers, Linux systems, Macs, etc. Hundreds of millions of systems.

Popular distros and OS X will get patched quickly, but what about all the embedded Linux systems on routers, NAS boxes, old file servers, etc that never get updated?
 

shuri

Banned
The Apocalypse Horns are now blaring at my workplace about this. Sooo many devices, so many machines, so many servers.
 

Jezbollah

Member
Another bit of info:

http://www.theregister.co.uk/2014/09/25/shell_shocked_not_yet/

Researcher Robert Graham has so far dug up 3,000 vulnerable systems by scanning port 80 on the root URL, and said the bug was "clearly wormable".

His figures should increase quickly since that only one in 50 web servers respond correctly without the proper Host field.

"Scanning with the correct domain names would lead to a lot more results -- about 50 times more," Graham writes.

Graham adds: "Secondly, it's things like CGI scripts that are vulnerable, deep within a website (like CPanel's /cgi-sys/defaultwebpage.cgi). Getting just the root page is the thing least likely to be vulnerable. Spidering the site, and testing well-known CGI scripts (like the CPanel one) would give a lot more results, at least 10x [more]."

He also writes that embedded web servers on odd ports "are the real danger" as well other services like the DHCP service reported in the initial advisory.

"Consequently, even though my light scan found only 3000 results, this thing is clearly wormable, and can easily worm past firewalls and infect lots of systems," Graham said.

"One key question is whether Mac OS X and iPhone DHCP service is vulnerable – once the worm gets behind a firewall and runs a hostile DHCP server, that would 'game over' for large networks."

He agrees Shell Shock was more severe than the OpenSSL HeartBleed vulnerability reported in April and warned that while primary servers were likely not vulnerable, "everything else probably is".

"Scan your network for things like Telnet, FTP, and old versions of Apache (masscan is extremely useful for this). Anything that responds is probably an old device needing a bash patch. And, since most of them can't be patched, you are likely screwed."
 

Blizzard

Banned
A couple more links for reference:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271
https://marc.info/?l=oss-security&m=141157106132018&w=2

And shuri, your picture URL is censored, but I wish I had Apocalypse Horns. Those sound awesome.
Rehosted for you:
article-2507778-196d65xemr.jpg
 

itxaka

Defeatist
Funny how this isn't getting nearly as much press as Heartbleed when it's potentially much worse.

Heartbleed allowed someone to grab a random snippet of data from a system, but only ones running OpenSSL and, of those, only ones running versions released in a window of a couple of years. Something like 500,000 systems total.

This allows an attacker to do anything on an affected system, and it affects any Linux or UNIX system running any version of bash from the last 25 years, which is basically all of them. That's more than half of all web servers, Linux systems, Macs, etc. Hundreds of millions of systems.

Popular distros and OS X will get patched quickly, but what about all the embedded Linux systems on routers, NAS boxes, old file servers, etc that never get updated?

Routers and nas probably use plain sh instead of bash
 

SirCheese

Member
I'm surprised this thread isn't getting more replies. It's a huge potential threat, but I guess GAFers are more concerned about their phones bending.

Just spent an hour educating myself about different Linux shells and trying to find out if my router at home is vulnerable. At work, so can't do the test.

Btw, does anyone know if ElementaryOS is running Bash? What I've read seems to indicate that is running Dash, since it's based on Ubuntu.
 

kingslunk

Member
I'm surprised this thread isn't getting more replies. It's a huge potential threat, but I guess GAFers are more concerned about their phones bending.

Just spent an hour educating myself about different Linux shells and trying to find out if my router at home is vulnerable. At work, so can't do the test.

Btw, does anyone know if ElementaryOS is running Bash? What I've read seems to indicate that is running Dash, since it's based on Ubuntu.

Average people don't understand the extent of this probably.
 

Slavik81

Member
Funny how this isn't getting nearly as much press as Heartbleed when it's potentially much worse.

Heartbleed allowed someone to grab a random snippet of data from a system, but only ones running OpenSSL and, of those, only ones running versions released in a window of a couple of years. Something like 500,000 systems total.

This allows an attacker to do anything on an affected system, and it affects any Linux or UNIX system running any version of bash from the last 25 years, which is basically all of them. That's more than half of all web servers, Linux systems, Macs, etc. Hundreds of millions of systems.

Popular distros and OS X will get patched quickly, but what about all the embedded Linux systems on routers, NAS boxes, old file servers, etc that never get updated?
This only can be used against systems that put data from the internet into environment variables and then call a bash script. Heartbleed leaked private data from basically anything that used OpenSSH.
 

kingslunk

Member
This only can be used against systems that put data from the internet into environment variables and then call a bash script. Heartbleed leaked private data from basically anything that used OpenSSH.

OpenSSL.

Anything that touches environment vars or gets called by the shell is affected.
 

Slavik81

Member
OpenSSL.

Anything that touches environment vars or gets called by the shell is affected.
Sorry. I meant OpenSSL. Though, OpenSSH was also affected; it uses OpenSSL.

And I do reiterate that not everything that touches environment variables or gets called by the shell is affected. The server is onpy compromised if the attacker can set the contents of environment variables then start a new instance of bash.

It's a big problem, yes, but the list of working attacks based on this vector is still rather low compared to heartbleed. Hitting old CGI webservers are the only proven attacks I've seen thus far.
 

Darkangel

Member
Makes you wonder what other security threats are just lying around undiscovered.

Hopefully undiscovered...
 

_Ryo_

Member
How would you go about this test on Linux Mint 17?

I've entered the test into the terminal but it doesn't really give any result. Is it because Linux Mint 17 uses Dash or that it's already patched?

For reference here is the output

Input:
ryo@ryo-pc-2045 ~ $ env x='() { :;}; echo vulnerable’ bash -c “echo this is a test”

Output:
 

Jobiensis

Member
How would you go about this test on Linux Mint 17?

I've entered the test into the terminal but it doesn't really give any result. Is it because Linux Mint 17 uses Dash or that it's already patched?

For reference here is the output

Input:

Output:

You need to fix up the double quotes, somewhere 'smart quotes' mangled them.

Code:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
 

Slavik81

Member
You seem to have some unicode symbols instead of standard quotes in your command.

Microsoft Office likes to replace " and - with fancier-looking symbols. Be very careful when copying or pasting shell commands in Outlook or Word. It's a common cause of those sorts of problems.
 

_Ryo_

Member
You need to fix up the double quotes, somewhere 'smart quotes' mangled them.

Code:
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

Input:
Code:
ryo@ryo-pc-2045 ~ $ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

Output:
Code:
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test

Hmm.

Linux Mint forums says to just use MintUpdate and I've already done so.
 

Dicer

Banned
Code:
dicer@Alienware-X51:~$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test

Code:
dicer@Alienware-X51:~$ bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

Seems, I am o.k. for the moment, IT admins must be pulling hair out right now I imagine....
 

zoku88

Member
And this is why you should use zsh instead.:)

Kidding, I'm sure if more people used zsh, there would be some horrible bug found.
 

ricki42

Member
Average people don't understand the extent of this probably.

I think a lot of people still hear 'Linux' and think 'that weirdo computer thing geeks play around with in the basement'.

What surprises me is that this wasn't found earlier. There are enough people using bash, I would have expected somebody to stumble across this far sooner.
 

Dicer

Banned
I think a lot of people still hear 'Linux' and think 'that weirdo computer thing geeks play around with in the basement'.

What surprises me is that this wasn't found earlier. There are enough people using bash, I would have expected somebody to stumble across this far sooner.

It may have been, not everyone wants these holes plugged up...
 

BaBaRaRa

Member
a moment of silence, please, for every sysadmin working long into the night, cursing their boss for still 'considering' that puppetdb proposal they wrote a year ago
 
bash: x: line 0: syntax error near unexpected token `{:'
bash: x: line 0: `x () {:;}; echo vulnerable'
bash: error importing function definition for `x'
this is a test

let me just copy and paste from the OP double test it.
 

Dicer

Banned
vulnerable
this is a test

how do i update my bash shell? in OS X terminal?

Apple "should" push an update for this...but seeing as how their last update went...I kid I kid

http://www.tomsguide.com/us/shellshock-osx-linux,news-19614.html

Red Hat has already released its own patches that fix this flaw.

There don't appear to be any exploits related to this bug in the wild yet, but the flaw offers an opportunity for miscreants to attack OS X and desktop Linux, not to mention countless server builds. If Apple, Ubuntu, Mint, Debian or other Linux developers release operating-system updates this week, be sure to install them.
 

Syriel

Member
And this is why you should use zsh instead.:)

Kidding, I'm sure if more people used zsh, there would be some horrible bug found.

It may impact zsh as well.

And for people asking why this is a big deal...

User-Agent: () { :; }; /bin/cat /etc/shadow

You can do a lot of stuff with an open command line.
 

Dougald

Member
It may impact zsh as well.

And for people asking why this is a big deal...

User-Agent: () { :; }; /bin/cat /etc/shadow

You can do a lot of stuff with an open command line.

This is also why you don't run shit as root when you don't need to
 
Makes you wonder how many similar or worse vulnerabilities are hidden in the 200 million lines of codes a typical linux distro has. Not that other operating systems are any better. This stuff is just so incredibly complex and there are so many people involved, that I don't really have much trust in the security of modern software anymore.
 
Status
Not open for further replies.
Top Bottom