joomla未授权创建特权用户分析(CVE-2016-8870和CVE-2016-8869)

本文详细介绍了Joomla的CVE-2016-8870和CVE-2016-8869漏洞,即使在注册关闭的情况下也能创建用户。通过分析代码和复现过程,揭示了如何利用这些漏洞进行提权操作,特别是在用户权限设置上的关键步骤。
摘要由CSDN通过智能技术生成

今天突然看到joomla爆出新的漏洞,个人比较感兴趣所以分析了下。

漏洞新闻:http://bobao.360.cn/learning/detail/3139.html

1、漏洞影响版本

joomla 3.4.4 to 3.6.3

利用CVE-2016-8870,在网站关闭注册的情况下仍可创建用户

利用CVE-2016-8869,进行提权

2、漏洞复现

2.1 利用CVE-2016-8870创建用户

位于components/com_users/controllers下的registration.phpuser.php有如下代码:

首先是registration.phpUsersControllerRegistration类的register函数的部分代码如下:

这里写图片描述

然后是user.phpUsersControllerUser类的register函数的完整代码如下:


public function register()
{
   
  JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));

  // Get the application
  $app = JFactory::getApplication();

  // Get the form data.
  $data = $this->input->post->get('user', array(), 'array');

  // Get the model and validate the data.
  $model  = $this->getModel('Registration', 'UsersModel');

  $form = $model->getForm();

  if (!$form)
  {
     JError::raiseError(500, $model->getError());

     return false;
  }

  $return = $model->validate($form, $data);

  // Check for errors.
  if ($return === false)
  {
     // Get the validation messages.
     $errors = $model->getErrors();

     // Push up to three validation messages out to the user.
     for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
     {
        if ($errors[$i] instanceof Exception)
        {
           $app->enqueueMessage($errors[$i]->getMessage(), 'notice');

           continue;
        }

        $app->enqueueMessage($errors[$i], 'notice');
     }

     // Save the data in the session.
     $app->setUserState('users.registration.form.data', $data);

     // Redirect back to the registration form.
     $this->setRedirect('index.php?option=com_users&view=registration');

     return false;
  }

  // Finish the registration.
  $return = $model->register($data);

  // Check for errors.
  if ($return === false)
  {
     // Save the data in the session.
     $app->setUserState('us
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 11
    评论
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值