> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Check If Your Linux System Is Vulnerable To Shellshock And Fix It
- URL: https://itsfoss.com/linux-shellshock-check-fix/
- Published: 2014-09-27T20:04:08.000Z
- Updated: 2023-01-11T09:56:09.000Z
- Author: Abhishek Prakash
- Tags: #Import 2022-12-26 08:27

[![How to check if your Linux is impacted with Shellshock bash bug](https://itsfoss.com/content/images/wordpress/2014/09/shellshock_Linux_check.jpeg)](https://itsfoss.com/content/images/wordpress/2014/09/shellshock%5FLinux%5Fcheck.jpeg)

Quick tutorial to show you **how to check if your Linux system is impacted with Shellshock** and if yes, **how to fix the system for Bash Bug exploit**.

If you are following news, you might have heard about a vulnerability found in [Bash](http://en.wikipedia.org/wiki/Bash%5F%28Unix%5Fshell%29?ref=itsfoss.com), which is known as **Bash Bug** or **Shellshock**. [Red Hat](https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/?ref=itsfoss.com) was the first to discover this vulnerability. This Shellshock bug allows attackers to inject their own code and thus leaves the system open to various malicious and remote attacks. In fact, [hackers are already exploiting it to launch DDoS attacks](http://www.wired.com/2014/09/hackers-already-using-shellshock-bug-create-botnets-ddos-attacks/?ref=itsfoss.com).

Since Bash is found on all Unix-like system, it leaves all Linux systems vulnerable to this Shellshock bug if those are running a specific version of Bash.

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

I tried it on my Ubuntu 14.10 and here is what I got:

[![Check Linux for Shellshock vulnerability ](https://itsfoss.com/content/images/wordpress/2014/09/Shellshock_Linux_Check.jpeg)](https://itsfoss.com/content/images/wordpress/2014/09/Shellshock%5FLinux%5FCheck.jpeg)

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
```

I hope this quick tip helps you to see if you are impacted with Shellshock bug and also to fix it. Questions and suggestions are always welcomed.