Wondering if your Linux system has been impacted by Shellshock? There is an easy way to check it, which we are about to see.
Check Linux system for Shellshock vulnerability
Open a terminal and run the following command in it:
env x='() { :;}; echo vulnerable' bash -c 'echo hello'
If your system is NOT vulnerable, you will see an output like this:
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x’
hello
If your system is vulnerable to Shellshock bug, you’ll see an output like this:
vulnerable
hello
You can also check the bash version in use by using the command below:
bash --version
If the bash version in use is 3.2.51(1), you should update it.
Patch Linux system for Shellshock vulnerability
If you are running a Debian based Linux OS such as Ubuntu, Linux Mint etc, use the following command to upgrade Bash:
sudo apt-get update && sudo apt-get install --only-upgrade bash
For Linux OS like Fedora, Red Hat, Cent OS etc, use the following command:
yum -y update bash
http://itsfoss.com/linux-shellshock-check-fix/