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. itertools 介绍

    在python中itertool为python提供一系列迭代iterator的方法. 第一个:组合 排列 itertools.combinations(sq, r) 该函数的作用是在列表sq中穷举所有 ...

  2. windows查看端口命令

    netstat -ano 查看所有端口 netstat -ano|findstr "1935" 查看1935端口占用PID tasklist|findstr "PID”

  3. oslo.messaging 1.8.0 bug fix and blueprint

    1366597 由于amqp_auto_delete可配置,但是NotifierPublisher使用的是没有在配置中获取而使用的默认的False,即非auo_delete,因而在用户配置了amqp_ ...

  4. LeetCode Shortest Distance from All Buildings

    原题链接在这里:https://leetcode.com/problems/shortest-distance-from-all-buildings/ 题目: You want to build a ...

  5. mysql qps tps计算

    Information from web QPS (Query per second) (每秒查询量)TPS(Transaction per second) (每秒事务量,如果是InnoDB会显示,没 ...

  6. ios每日一发--仿侧边抽屉效果

    效果图如下 代码实现以及思路下面分析: 代码创建导航控制器 Appdelegate.m中 #import "AppDelegate.h" #import "ViewCon ...

  7. leetcode105:Construct Binary Tree from Preorder and Inorder Traversal

    题目: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume t ...

  8. svg学习(七)polygon

    <polygon> 标签用来创建含有不少于三个边的图形. <?xml version="1.0" standalone="no"?> & ...

  9. 我的新发现:AVL树旋转的一个特性

    关于AVL树旋转的代码网络上铺天盖地. 一些经典的实现方法如下: AVLTree SingleLeftRotation(AVLTree A) { AVLTree B = A->left; A-& ...

  10. QQ 图片

    http://wpa.qq.com/pa?p=2:QQ号码:45 查看QQ是否在线,或者图片,在这里,其他的另行百度. <!-- tencent://message/?uin=763999883 ...