尊敬的用户: 
  
您好,日前Linux GNU glibc标准库的 gethostbyname函数爆出缓冲区溢出漏洞,漏洞编号为CVE-2015-0235。黑客可以通过gethostbyname系列函数实现远程代码执行,获取服务器的控制权及Shell权限,此漏洞触发途径多,影响范围大,请大家关注和及时临时修复,后续我们会尽快更新镜像修复。请知晓。 
 
一、    漏洞发布日期  
2015年1月27日 
 
 
二、    已确认被成功利用的软件及系统  
Glibc 2.2到2.17 (包含2.2和2.17版本)  
 
三、    漏洞描述  
GNU glibc标准库的gethostbyname 函数爆出缓冲区溢出漏洞,漏洞编号:CVE-2015-0235。 Glibc 是提供系统调用和基本函数的 C 库,比如open, malloc, printf等等。所有动态连接的程序都要用到Glibc。远程攻击者可以利用这个漏洞执行任意代码并提升运行应用程序的用户的权限。  
 
四、    漏洞检测方法 
 
 
按照说明操作即可。 
#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("notvulnerable");   
    exit(EXIT_SUCCESS);   
  }   
  puts("should nothappen");   
  exit(EXIT_FAILURE);   
}
 
 
将上述代码内容保存为GHOST.c 
执行gcc GHOST.c -o GHOST
 
 
 
 
$./GHOST   
vulnerable 
表示存在漏洞,需要进行修复。 
 
$./GHOST   
notvulnerable 
表示修复成功。 
 
五、    建议修补方案 
 
  
特别提示:由于glibc属于Linux系统基础组件,为了避免修补对您服务器造成影响,建议您选择合适时间进行修复,同时务必在修复前通过快照操作进行备份,如果修复出现问题,可以迅速回滚快照恢复。 
 
 
 
Centos 5/6/7: 
 
 
yum update glibc 
 
 
Ubuntu 12/14 
apt-get update 
apt-get install libc6 
 
 
Debian 6 
 
 
wget -O /etc/apt/sources.list.d/debian6-lts.list http://mirrors.aliyun.com/repo/debian6-lts.list 
apt-get update 
apt-get install libc6
 
 
 
 
Debian 7 
 
 
apt-get update 
apt-get install libc6 
 
 
Opensuse 13 
 
 
zypper refresh 
zypper update glibc* 
 
 
Aliyun linux 5u7 
 
 
wget -O /etc/yum.repos.d/aliyun-5.repo http://mirrors.aliyun.com/repo/aliyun-5.repo  
yum update glibc
 
 



周五, 一月 30, 2015

« 返回到产品列表