Diferencia entre revisiones de «Shellshock bash security update»

De GIGAS DOCS
Saltar a: navegación, buscar
Línea 1: Línea 1:
 
{{en español |Shellshock_(actualización_de_seguridad_en_bash)}}
 
{{en español |Shellshock_(actualización_de_seguridad_en_bash)}}
 +
{{en Portugués |Shellshock_(actualización_de_seguridad_en_bash)}}
  
 
This problem is originated in the way Bash interpreter evaluates environment variables. The result is that an attacker may use this vulnerability to bypass environment restrictions and thus being able to execute shell commands from Bash in an indiscriminate way. This problem has arisen into a related vulnerability called "Shellshock".
 
This problem is originated in the way Bash interpreter evaluates environment variables. The result is that an attacker may use this vulnerability to bypass environment restrictions and thus being able to execute shell commands from Bash in an indiscriminate way. This problem has arisen into a related vulnerability called "Shellshock".

Revisión del 18:30 20 abr 2021

El problema tiene origen en el modo que Bash evalúa las variables de entorno. El resultado es que el atacante puede usar esta vulnerabilidad para saltarse las restricciones del entorno y ejecutar comandos de shell desde bash de forma indiscriminada y en base a ello ha aparecido una nueva vulnerabilidad relacionada conocida como “Shellshock“.

El mayor problema de esto es que ciertos servicios y aplicaciones conceden acceso a estas variables de entorno y por consiguiente permiten explotar la vulnerabilidad desde dichas aplicaciones y servicios; vamos, que no es necesario disponer de acceso directo a la línea de comandos, terminal o SSH para explotar la vulnerabilidad.

Así pues, es muy importante actualizar la versión de bash lo antes posible por la que contenga el parche que solucione el bug lo antes posible. Es tan sencillo como ejecutar los siguientes updates a través de yum o apt según el sistema:

¿Cómo identificar si mi servidor es vulnerable frente a esta amenaza?

Para detectar si tu servidor tiene una versión de bash afectada por este fallo de seguridad, puedes conectarte a tu servidor por SSH y ejecutar:

env x='() { :;}; echo Vulnerable' bash -c /bin/true

Si es vulnerable la salida estándar de este comando te devolverá la palabra 'Vulnerable'

Si no es vulnerable no te devolverá nada.

¿Cómo securizar mi servidor frente a este fallo se seguridad si mi servidor está afectado?

Tienes que acceder a tu servidor por SSH con usuario root y ejecutar los siguientes comandos dependiendo de tu distribución de Linux.

Si tienes Debian y derivados (Ubuntu, etc)

  • Si quieres saber tu versión de Debian ejecuta:
cat /etc/debian_version

Solucionar “Shellshock” en Debian 7 y Ubuntu

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

Solucionar “Shellshock” en Debian 6

Para actualizar bash en Debian 6, primero tenemos que agregar un repositorio.

Para ello tenemos que editar el siguiente archivo:

/etc/apt/sources.list

Y agregar la siguiente linea al final del mismo:

deb http://ftp.us.debian.org/debian squeeze-lts main non-free contrib

Una vez agregado el repositorio seguir los pasos para securización de Debian 7.

Finalmente, quita el repositorio borrando la línea que hemos agregar en el fichero sources.list

  • Si en esta versión de Debian aparece un error como este:
W: GPG error: http://ftp.us.debian.org squeeze-lts Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXX

Basta con ejecutar los comandos:

gpg --keyserver pgpkeys.mit.edu --recv-key  XXXX    
gpg -a --export XXXX | apt-key add -

Poniendo el mismo id en las XXXX que aparece en el error.

Solucionar “Shellshock” en CentOS, RHEL, Fedora, Scientific Linux

yum update bash

Con estas acciones tu servidor ya estará protegido frente a este fallo de seguridad.

Si te ha quedado alguna duda o quieres más información recuerda que dispones de soporte las 24 horas del día los 365 días de la semana por chat, teléfono y ticket.

This problem is originated in the way Bash interpreter evaluates environment variables. The result is that an attacker may use this vulnerability to bypass environment restrictions and thus being able to execute shell commands from Bash in an indiscriminate way. This problem has arisen into a related vulnerability called "Shellshock".

The biggest problem is that certain services and applications grant access to these environment variables and thus allow the vulnerability exploitation from within those applications and services. Thats it, it is not necessary to have direct access to the command line, terminal or SSH in order to exploit this vulnerability.

As a result, it is very important to update Bash version as soon as possible with the one including the patch resolving the bug. It is very easy: just follow these updates through yum or apt depending on the system:

How to determine if my server is vulnerable against this vulnerability?

To detect if your servers has a version of Bash suffering this security flaw, you can connect to your server through SSH and execute:

env x='() { :;}; echo Vulnerable' bash -c /bin/true

If it is vulnerable, the standard output of this commando will return the word 'Vulnerable'.

Otherwise, if it is not vulnerable, the above command will return nothing.

How to secure my server against this security vulnerability if my server affected?

You have to access your server through SSH as root and run the following commands, depending on your Linux distribution.

Debian and derivative (Ubuntu, etc)

  • If you want to know your Debian version, run:
cat /etc/debian_version

Fix “Shellshock” on Debian 7 and Ubuntu

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

Fix “Shellshock” on Debian 6

To update Bash on Debian 6, you first have to add an apt repository.

You have to edit this file:

/etc/apt/sources.list

And add this line under the last line on that file:

deb http://ftp.us.debian.org/debian squeeze-lts main non-free contrib

Once the repository is added, follow the steps to securize Debian 7.

Finally , remove the repository by removing the line that you added previously to sources.list file.

  • If your Debian version has an error like this when doing "apt-get update":
W: GPG error: http://ftp.us.debian.org squeeze-lts Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXX

It is as easy as running:

gpg --keyserver pgpkeys.mit.edu --recv-key XXXX
gpg -a --export XXXX | apt-key add -

Remember to replace XXXX by the id appeared in the error.

Fix “Shellshock” on CentOS, RHEL, Fedora, Scientific Linux

yum update bash


Whith these operations your server will be protected against this security failure.

If you have doubts or need further information remember we are available 24x7, 365 days chat, phone and ticket.