ShellShock Bash Vulnerability

In past few days you must have heard about a vulnerability in BASH which allow remote execution of commands. Any version of BASH older than bash-4.1.2-15.el6_5.2 is vulnerable to remote execution. Which is a very serious security threat.

Read more about this Shellshock Bug.


What is BASH?

It’ the default interactive shell in Linux. When you are interacting with the terminal via any  terminal emulator, over a tty, or ssh) you are generally typing commands that bash will read and execute. Even if you do not use the terminal at all, you still have Bash on the system/server.


The vulnerability arises from how Bash handles “environmental variables.” If you are some kind of a hacker or a genius & you know about the vulnerability, you can easily trick Bash into executing commands that it shouldn’t be executing!


AM I Vulnerable?

If you are running any version of Linux chances are you’are vulnerable! Only Servers with cPanel installed or Auto Updates enabled are ones which are already patched, Because cPanel rolls all the updates as soon as they arrive.

By running the following command in Shell you can find out about your Server.


env uncovertech='() { :;}; echo Bash is vulnerable!' bash -c "echo Bash Test, Powered by" 


If result of command is “Bash Test, Powered by”

Congratulations, you are safe! means you have either the latest version which has already been patched or some older version which is not vulnerable to ShellShock Bug.

But if result of the command is something like

“Bash is Vulnerable!

Bash Test, Powered by”

Sorry your server is vulnerable to ShellShock Bug (BASH Vulnerability).

How to Update?

The standard update manager will offer you this update, This why updates are important, no matter what variant if Linux you use or how well-maintained it is.


Debian Based

If your server is Debain Based (Debian or Ubuntu) you can run the following two commands,

apt-get update
apt-get install --only-upgrade bash

The 1st command makes sure that you have the newest package list that includes the fixed version, and the 2nd command installs the newest (fixed) version of bash.

Redhat Based

If you are on Redhat based Server (CentOS) you need to run the following command,

yum update bash

The command will only update bash package (The one which has already been patched).


Feel free to drop feedback/suggestions in comments section, Or share if you have any better way to check for the Vulnerability.