CVE-2014-7169 BASH Shell Shock Vulnerability for Linux & How to fix

I guess by now we all heard about Bash Shell shock vulnerability and how dangerous it could be .

What is CVE-2014-7169 / Shell Shock Vulnerability?

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of environment variables, which allows remote attackers to write to files or possibly have unknown other impact via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution.

NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271.

In short Shell Shock vulnerability allows remote attackers to execute arbitrary code given certain conditions, by passing strings of code following environment variable assignments.

The Shell Shock vulnerability  is considered  bigger  than Heartbleed as it’s affecting all  versions of bash  and it’s still unclear from  when and adding to that linux bash is not only running on linux webservers  but other embedded devices as well such as Mac Laptops .

 

Am I Affected ? 

To test,  if your version of Bash is vulnerable to this , run the below command ::

root@server[#]  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

If you get the above output then you are safe.

But,  if you get the below output then you are affected

root@server[#]  env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
vulnerable
this is a test

How to fix ?

For RedHat/CentOS/Fedora/RPM based OS:
Note:: This is a temporary fix released by Red Hat Security Team. The team is still working on a full fix which is expected to release soon.
root@server[#] yum upgrade bash
APT-GET: Ubuntu / Debian
sudo apt-get update && sudo apt-get install --only-upgrade bash
External References:

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271

https://bugzilla.redhat.com/show_bug.cgi?id=1141597

https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/

https://access.redhat.com/articles/1200223

https://access.redhat.com/security/cve/CVE-2014-6271

http://askubuntu.com/questions/528101/what-is-the-cve-2014-6271-bash-vulnerability-shellshock-and-how-do-i-fix-it

http://cpanel.net/cpanel-security-team-bash-cve-2014-6217-and-cve-2014-7169/

That’s all.

 

 

 

How to setup additional user for Plesk web-stats

If you want to  setup / allow additional  user for Plesk web-stats then follow the below simple steps ::

Go to Plesk >> Domains >> Select the Domain and locate the Protected URL or Password Protect option and then click on Plesk-stat >> Add a new user .

That’s All, easy isn’t it.

 

How to find the External IP if it is Natted

If you are behind a NAT  and want to  find the real / external IP from  the server then execute one of the below command from the server ::

root@server[#] curl -s http://checkip.dyndns.org | html2text | awk -F ':' '{print $2}'

or

root@server[#] curl http://icanhazip.com/

or

root@server[#] curl http://myexternalip.com/raw

or

root@server[#] curl  ifconfig.me

The last one is a bit slower but it does show the external IP.

That’s all.