幽灵漏洞(GHOST)影响大量Linux操作系统及其发行版

管理员 业界动态幽灵漏洞(GHOST)影响大量Linux操作系统及其发行版已关闭评论7,6031字数 1459阅读4分51秒阅读模式

安全研究人员近日曝出一个名为幽灵(GHOST)的严重安全漏洞,这个漏洞可以允许攻击者远程获取操作系统的最高控制权限,影响市面上大量Linux操作系统及其发行版。该漏洞CVE编号为CVE-2015-0235。

什么是glibc文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

glibc是GNU发布的libc库,即c运行库。glibc是linux系统中最底层的api,几乎其它任何运行库都会依赖于glibc。 glibc除了封装linux操作系统所提供的系统服务外,它本身也提供了许多其它一些必要功能服务的实现。glibc囊括了几乎所有的UNIX通行的标 准。文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

漏洞概述文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

代码审计公司Qualys的研究人员在glibc库中的__nss_hostname_digits_dots()函数中发现了一个缓冲区溢出的漏洞,这个bug可以经过gethostbyname*()函数被本地或者远程的触发。文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

应用程序主要使用gethostbyname*()函数发起DNS请求,这个函数会将主机名称转换为ip地址。文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

影响范围文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

该漏洞影响glibc库版本2.2-2.17的Linux操作系统文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

操作系统类型包括文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

CentOS 6 & 7
Debian 7
Red Hat Enterprise Linux 6 & 7
Ubuntu 10.04 & 12.04
各Linux发行版

漏洞测试文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

1、编译以下测试代码
文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <gnu/libc-version.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、上述测试程序可以显示出glibc版本和主机是否存在漏洞文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

gcc gistfile1.c -o CVE-2015-0235
./CVE-2015-0235

文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

[参考信息来源threatpost360,转载须注明来自FreeBuf黑客与极客(FreeBuf.COM)]文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/ 文章源自运维生存时间-https://www.ttlsa.com/news/linux-ghost-2015/

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
管理员
  • 本文由 发表于 28/01/2015 14:53:05
  • 转载请务必保留本文链接:https://www.ttlsa.com/news/linux-ghost-2015/