ghost-linux-security-vulnerabilitySatu lubang keselamatan yang membolehkan sistem linux anda di ceroboh secara kawalan . 
Di bawah ini adalah cara untuk membuat ujian sama ada sistem linux anda terjejas 
dan perlu di tampal atau tidak .

Versi yang telah di laporkan terlibat.

  • RHEL (Red Hat Enterprise Linux) version 5.x, 6.x and 7.x
  • CentOS Linux version 5.x, 6.x & 7.x
  • Ubuntu Linux version 10.04, 12.04 LTS
  • Debian Linux version 7.x
  • Linux Mint version 13.0
  • Fedora Linux version 19 or older
  • SUSE Linux Enterprise 11 and older (also OpenSuse Linux 11 or older versions).
  • Arch Linux glibc version <= 2.18-1
Salin kod C di bawah..

/* ghosttest.c:  GHOST vulnerability tester */
/* Credit: 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);
}


Compile dan larikan
$ gcc ghosttest.c -o ghosttest
$ ./ghosttest

ATAU

wget https://gist.githubusercontent.com/koelling/ef9b2b9d0be6d6dbab63/raw/de1730049198c64eaf8f8ab015a3c8b23b63fd34/gistfile1.c

gcc gistfile1.c -o CVE-2015-0235

./CVE-2015-0235
Contoh keputusan 

contoh dari keputusan  Debian v7.8:

not vulnerable

Contoh keputusan ujian ke atas Ubuntu 12.04 LTS server:

vulnerabl

Jika keputusan ujian anda positif , jangan lupa patch server anda.

Untuk server centos 

$yum clean all && yum update "glibc*"

Downloading Packages:
(1/3): glibc-2.12-1.149.el6_6.5.x86_64.rpm | 3.8 MB 00:08
(2/3): glibc-common-2.12-1.149.el6_6.5.x86_64.rpm | 14 MB 00:25
(3/3): nscd-2.12-1.149.el6_6.5.x86_64.rpm | 222 kB 00:00


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

By hasnan

Diploma dalam Sains Komputer (IT) dari UTM Ijazah Sarjana Muda Sains Komputer (IT) dari UKM