Contributor:
James.Maude
October 2nd, 2014

Shellshock: What you need to know

The InfoSec community has gone into overdrive in the last few days dealing with the ‘Shellshock’ bug. There is good reason for this, millions of systems around the globe are vulnerable to this bug which lets attackers run code on that system.

So what is Shellshock?

Shellshock or CVE 2014-6271 is an incredibly simple bug that requires no advanced code or sophisticated setup. In truth, it’s astonishing that it has taken so long to surface.

The bug is in Bash (Bourne Again Shell) the command interpreter used in Linux, Unix and OSX operating systems. It exploits the fact that Bash executes any code that is tagged onto the end of a function without validation. This allows attackers to disclose data and run commands on a target system.

Why is it such a big problem?

The reason the problem is so wide spread is that Bash is widely installed on a range of devices such as routers, industrial control systems and servers. The main concern at the moment is systems that are directly connected to the internet can be exploited remotely by attackers. Shodan has already shown that a huge number of critical systems and industrial controls are connected directly to the internet and are potentially vulnerable.

Internal systems also need to be patched as they present a target to attackers who manage to infiltrate the network. Many embedded devices such as VoIP phones and network printers will prove a significant challenge as manufacturers are slow to issue updates for older equipment. This was proven after Heartbleed where a significant number of devices never received an update.

What to do?

Businesses should identify and patch vulnerable systems as soon as possible as thousands of attacks are already targeting this bug. The good news is that despite the wide spread use of Bash not all systems are externally vulnerable. The most common problem areas are Apache web servers using mod_cgi, mod_cgid or Git over SSH. Although OSX does contain the bug it is safe by default unless users have configured the advanced UNIX services.

The key to success is being able to rapidly identify vulnerable systems and either patch or take them offline. External and cloud service providers are being generally proactive in warning users of issues and taking steps to resolve them. With the internet awash with these attacks it is best to take immediate action especially with business critical systems.

The technical summary

The issue is in the way in which Bash handles functions, it looks at the command and identifies the function definition using ” (){ ” characters. It then evaluates and executes this definition using the parse_and_execute() function. So if we add some extra commands after the function definition these should also be executed.

We can test this by running the following command.

myTest=’(){;}; echo “This is bad"’ bash -c "echo This is OK"

If we run this command on a vulnerable host it will print “This is bad” if it does not print this and just prints “This is OK” then the system is not vulnerable.

More from the Blog

Related technology and security insights

  • 28
    Jun
  • Story related

    NotPetya ransomware: Attack analysis

    On June 27, 2017 a number of organisations across Europe began reporting significant system outages caused by a ransomware strain referred to as Petya. The ransomware is very similar to older Petya ransomware attacks from previous years, but the infection ...