GHOST: glibc , alerta distros de Linux

Publicado por frhfpwimb, Enero 27, 2015, 20:30:08

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

frhfpwimb

Cita de: https://threatpost.com/ghost-glibc-remote-code-execution-vulnerability-affects-all-linux-systems/110679A critical vulnerability has been found in glibc, the GNU C library, that affects all Linux systems dating back to 2000. Attackers can use this flaw to execute code and remotely gain control of Linux machines.f


Fuente del fallo: http://www.openwall.com/lists/oss-security/2015/01/27/9
POR FAVOR: Considere hacer una donación para que de esta forma se pueda pagar el housing así esta comunidad pueda seguir en linea.

ThecaTTony

Gracias por la info.

Pasos para comprobar si un sistema es vulnerable o no:

1- Pegar el siguiente código en un archivo llamado GHOST.c
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#define CANARY "in_the_coal_mine"

struct {
  char buffer[1024];
  char canary[sizeof(CANARY)];
} temp = { "buffer", CANARY };

int main(void) {
  struct hostent resbuf;
  struct hostent *result;
  int herrno;
  int retval;

  /*** strlen (name) = size_needed - sizeof (*host_addr) - sizeof (*h_addr_ptrs) - 1; ***/
  size_t len = sizeof(temp.buffer) - 16*sizeof(unsigned char) - 2*sizeof(char *) - 1;
  char name[sizeof(temp.buffer)];
  memset(name, '0', len);
  name[len] = '\0';

  retval = gethostbyname_r(name, &resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno);

  if (strcmp(temp.canary, CANARY) != 0) {
    puts("vulnerable");
    exit(EXIT_SUCCESS);
  }
  if (retval == ERANGE) {
    puts("not vulnerable");
    exit(EXIT_SUCCESS);
  }
  puts("should not happen");
  exit(EXIT_FAILURE);
}


2- Compilar dicho código con el siguiente mandato:
$ gcc GHOST.c -o GHOST

3- Ejecutar el binario creado:
$ ./GHOST

Si el mismo devuelve: not vulnerable no hay problema.
Si devuelve: vulnerable hay problemas y deberían actualizar las librerías glibc cuanto antes.

judoka

Look around, nobody's here. This is the land of the bots. Have fun.