ARGENTOP2P

Discusion General => Noticias de Ayer => Mensaje publicado por: frhfpwimb en Enero 27, 2015, 20:30:08

Título: GHOST: glibc , alerta distros de Linux
Publicado por: frhfpwimb en Enero 27, 2015, 20:30:08
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
Título: Re:GHOST: glibc , alerta distros de Linux
Publicado por: ThecaTTony en Enero 28, 2015, 04:01:31
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.
Título: Re:GHOST: glibc , alerta distros de Linux
Publicado por: judoka en Enero 28, 2015, 09:39:01
Gracias a los dos por la info