Golfreeze.packetlove.com: Life style of Golfreeze Canon400D Family kammtan.com Jazz Freebsd Unix Linux System Admin guitar Music

All about unix linux freebsd and FAQ for Packetlove.com Web hosting , Mail hosting , VoIP + IP PBX server => All Security via cyber space relate golfreeze task. => Topic started by: golfreeze on กุมภาพันธ์ 11, 2015, 11:40:37 PM

Title: GNU C Library (Glibc) called GHOST CVE-2015-0235
Post by: golfreeze on กุมภาพันธ์ 11, 2015, 11:40:37 PM
very serious security problem has been found in the GNU C Library (Glibc) called GHOST.
How can I fix GHOST vulnerability and protect my Linux server against the attack?
How do I verify that my server has been fixed against the Glibc GHOST vulnerability?

A very serious security problem has been found and patched in the GNU C Library called Glibc. It was announced on 27th January 2015.

http://www.cyberciti.biz/faq/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux/ (http://www.cyberciti.biz/faq/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux/)

http://www.openwall.com/lists/oss-security/2015/01/27/9 (http://www.openwall.com/lists/oss-security/2015/01/27/9)
Title: Re: GNU C Library (Glibc) called GHOST CVE-2015-0235
Post by: golfreeze on กุมภาพันธ์ 12, 2015, 09:24:24 AM
/* ghosttest.c:  GHOST vulnerability tester */
/* Credit: http://www.openwall.com/lists/oss-security/2015/01/27/9 (http://www.openwall.com/lists/oss-security/2015/01/27/9) */
#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);
}
Title: Re: GNU C Library (Glibc) called GHOST CVE-2015-0235
Post by: golfreeze on กุมภาพันธ์ 12, 2015, 09:25:06 AM
#gcc ghosttest.c -o ghosttest
#./ghosttest