1> Test if the problem exists, code:

    

#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h> #define CANARY "in_the_coal_mine" struct {
char buffer[];
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) - *sizeof(unsigned char) - *sizeof(char *) - ;
char name[sizeof(temp.buffer)];
memset(name, '', len);
name[len] = '\0'; retval = gethostbyname_r(name, &resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno); if (strcmp(temp.canary, CANARY) != ) {
puts("vulnerable");
exit(EXIT_SUCCESS);
}
if (retval == ERANGE) {
puts("not vulnerable");
exit(EXIT_SUCCESS);
}
puts("should not happen");
exit(EXIT_FAILURE);
}

2> 编译测试代码

    gcc code.c -o testGhost

    ./testGhost

    vulnerable  or  not vulnerable

3> 升级

    yum clean all 

    vi /etc/yum.repos.d/epel.repo  修改epel的https更新源为http

    yum update

[linux] Upgrading glibc for the GHOST Vulnerability的更多相关文章

  1. linux使用glibc版本安装mysql8.0.12

    1.前言 使用yum安装虽然很方便,但是如果要是在没有公网的环境下,是没有办法使用yum源的.所以我们可以使用mysql提供的glibc版本的安装包,进行安装. 但是在安装之前,一定要将以前的版本删除 ...

  2. Linux升级glibc

    参考http://www.linuxidc.com/Linux/2015-04/116472.htm via 红孩儿你好 一.简介 glibc是gnu发布的libc库,即c运行库.glibc是linu ...

  3. linux调试工具glibc的演示分析-core dump double free【转】

    转自:http://www.cnblogs.com/jiayy/p/3475544.html 偶然中发现,下面的两端代码表现不一样 void main(){ void* p1 = malloc(32) ...

  4. linux调试工具glibc的演示分析

    偶然中发现,下面的两端代码表现不一样 void main(){ void* p1 = malloc(32);       free(p1); free(p1); // 这里会报double free ...

  5. Linux系统glibc库版本信息查看

    原文链接:http://www.jbxue.com/LINUXjishu/29946.html 1. CentOS /lib/i386-linux-gnu/libc.so. 或 rpm -qi gli ...

  6. 【linux】glibc升级

    glibc升级 步骤如下: 1.下载解压glibc wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz tar zxvf glibc-2.18.ta ...

  7. 关于阿里云ECS Centos 5/6/7 Linux Glibc库严重安全漏洞修复方法

    日前Linux GNU glibc标准库的 gethostbyname函数爆出缓冲区溢出漏洞,漏洞编号为CVE-2015-0235.黑客可以通过gethostbyname系列函数实现远程代码执行,获取 ...

  8. glibc升级小记

    2015年元月最后几天,glibc幽灵漏洞来袭,引用 中华财经网的报道 稍做介绍: Linux glibc函数库日前曝出名为GHOST(幽灵)的高危漏洞,漏洞编号是CVE-2015-0235.攻击者可 ...

  9. Kali linux 2016.2(Rolling)中的Exploits模块详解

    简单来将,这个Exploits模块,就是针对不同的已知漏洞的利用程序. root@kali:~# msfconsole Unable to handle kernel NULL pointer der ...

随机推荐

  1. MySQL Access denied for user root@localhost 解决方法

    今天把本地开发的项目(ThinkPHP 3.2.3)移到虚拟机上(CentOS 6.6,LNMP 1.2,MySQL 5.6.23),配置好 MySQL 之后访问首页,出现: 此时 MySQL 的用户 ...

  2. 转: Linux磁盘扩容

    from:https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-mach ...

  3. MySQL创建数据库并赋予权限

    1.创建一个mysql用户并设置密码create user 'MySql用户名'@'localhost' identified by '密码';2.限制账户资源grant usage on *.* t ...

  4. Java学习-047-数值格式化及小数位数四舍五入

    此小工具类主要用于数值四舍五入.数值格式化输出,很简单,若想深入研究,敬请自行查阅 BigDecimal 或 DecimalFormat 的 API,BigDecimal.setScale(位数,四舍 ...

  5. FIO是测试IOPS

    FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...

  6. 关于thenao.scan() fn函数参数的说明

    theano.scan()原型: theano.scan( fn, sequences=None, outputs_info=None, non_sequences=None, n_steps=Non ...

  7. Netty之有效规避内存泄漏

    有过痛苦的经历,特别能写出深刻的文章 —— 凯尔文. 肖 直接内存是IO框架的绝配,但直接内存的分配销毁不易,所以使用内存池能大幅提高性能,也告别了频繁的GC.但,要重新培养被Java的自动垃圾回收惯 ...

  8. 2Sigma OA prepare: Friends Circle

    DFS & BFS: 关键在于构造graph package twoSigma; import java.util.ArrayList; import java.util.HashSet; i ...

  9. zjuoj 3602 Count the Trees

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3602 Count the Trees Time Limit: 2 Seco ...

  10. tp生成验证码

    视图层: <input type="text" name="code" value="" />        <img o ...