幽灵漏洞(Ghost gethost)
幽灵漏斗简介:
编号CVE-2015-0235的GHOST(幽灵)漏洞是Qualys研究员发现的一个Linux服务上非常严重的安全漏洞,可以被利用来远程代码执行及本地权限提升。
漏洞简要描述
该漏洞存在于 glic 库中的__nss_hostname_digits_dots() 函数,在nss/getXXbyYY.c这个文件中,gethostbyname()会使用这个功能。另外,这个漏洞本地远程都可以利用,要利用此漏洞,攻击者需要构造一个特定的 hostname 数据条给linux 上开放的服务,如果服务不对数据做安全处理,就会引发一个任意代码执行漏洞。
使用:ls –l /lib/libc.so.*查看本机libc的版本:

使用如下代码(来源于网络),测试是否存在漏洞:
#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);
}
编译后,执行,发现我们的一台服务器果然存在漏洞:

使用如下命令查看有那些进程依赖了libc: lsof | grep libc | awk '{print $1}' | sort | uniq | less

使用netstat –lntpu | grep 8080, 发现我们的8080端口依赖了libc,可以看到进程号是:26316

这里需要将gcc升级,升级后,漏洞被堵住。
打补丁攻略:
http://www.cyberciti.biz/faq/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux/
参考:
http://bobao.360.cn/news/detail/1166.html
http://www.freebuf.com/news/57729.html
https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt
幽灵漏洞(Ghost gethost)的更多相关文章
- Linux Glibc幽灵漏洞紧急修补方案【转】
转自:http://blog.csdn.net/chen19870707/article/details/43560823 幽灵漏洞是Linux glibc库上出现的一个严重的安全问题,他可以让攻击者 ...
- Linux幽灵漏洞修复
1. 漏洞说明 1.1 漏洞原理 glibc是GNU发布的libc库,即c运行库,在glibc库中的__nss_hostname_digits_dots()函数存在一个缓冲区溢出的漏洞,这个漏洞可以经 ...
- 检测Linux glibc幽灵漏洞和修补漏洞
1.首先安装rpm : sudo apt-get install rpm wget -OGHOST-test.sh http://www.antian365.com/lab/linux0day/G ...
- glibc漏洞监测并修复
[CVE 2015-0235: GNU glibc gethostbyname 缓冲区溢出漏洞 ]全面爆发,该漏洞的产生是Qualys公司在进行内部代码审核时,发现了一个在GNU C库(glibc)中 ...
- glibc升级小记
2015年元月最后几天,glibc幽灵漏洞来袭,引用 中华财经网的报道 稍做介绍: Linux glibc函数库日前曝出名为GHOST(幽灵)的高危漏洞,漏洞编号是CVE-2015-0235.攻击者可 ...
- Lookup component 用法
Lookup component 类似于Tsql的join子句, select a.* ,b.* from dbo.tis a left join dbo. tdes b on a.code=b.co ...
- 10个常见的IE bug和解决方法
1.IE6 幽灵文本(Ghost Text bug) 在我写本文之前,我遇到了这个bug.它相当的古怪和滑稽.一块不知哪来的重复的文本,被IE6显示在靠近原文本的下面.(译注:也可以参看 Explor ...
- 程序员的编辑器——VIM
from:http://blog.chinaunix.net/uid-11278770-id-148579.html Chinaunix首页 | 论坛 | 认证专区 | 博客 登录 | 注册 ...
- 阿里聚安全·安全周刊】一种秘密窃取数据的新型 Android 木马|iOS 11相机惊现BUG
本周的七个关键词: 新型 Android 木马丨 TLS 1.3 丨 阿里安全图灵实验室 丨 漏洞感染 Linux 服务器 丨 CPU曝极危漏洞 丨 iOS 11相机BUG 丨R2D2技术 - ...
随机推荐
- js 数组 转为树形结构
题目: source = [{ id: 1, pid: 0, name: 'body' }, { id: 2, pid: 1, name: 'title' }, { id: 3, pid: 2, na ...
- jquery append()方法与html()方法使用方法差别
append(content):方法在被选元素的结尾(仍然在内部)插入指定内容,有非常多朋友认为append与html差点儿相同.其他从英文意义上append是在原有基础上添加,而html中是替换当前 ...
- The cast to value type 'System.Decimal' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.
CurrentStock = db.BillEntry.Where(b => b.GoodsId == item.GoodsId).Sum(b => (decimal?)b.Qty) ?? ...
- 使用Repository Creation Utility创建档案库并连接
使用Repository Creation Utility创建档案库 档案库创建方式 1. 使用Repository Creation Utility创建 1.1使用下载的RCU http://www ...
- 〖Linux〗tmux 配置文件
tmux中默认的shell是zsh,zsh在日常中使用可以协助我们高效地使用shell命令. 配置文件默认位置 ~/.tmux.conf,此外,把常用快捷键也附录在这里,方便记忆. # 设置Shell ...
- RSA密钥生成、加密解密、签名验签
RSA 非对称加密公钥加密,私钥解密 私钥签名,公钥验签 下面是生成随机密钥对: //随机生成密钥对 KeyPairGenerator keyPairGen = null; try { keyPair ...
- SpringCloud学习资料
CSDN博客:http://blog.csdn.net/k21325/article/details/52789829 http://blog.csdn.net/qq_26562641/article ...
- PHP 调用ffmpeg
PHP 调用ffmpeg linux ffmpeg安装,tar文件安装一直出错,一直无语 php-ffmpeg安装, tar文件安装也一直出错,一直无语 最后直接在系统上安装ffmpeg sudo a ...
- Dubbo架构设计详解(转收藏)
转自:http://shiyanjun.cn/archives/325.html Dubbo是Alibaba开源的分布式服务框架,它最大的特点是按照分层的方式来架构,使用这种方式可以使各个层之间解耦合 ...
- 苹果后门、微软垄断与Linux缺位
7月21日,法国学者J.Zdziarski指出苹果系统存在人为的预先设置的"系统后门".危害用户的信息安全. 次日,苹果承认了系统存在诊断"后门". 7月28日 ...