之前4月13日在360的漏洞平台提交过一次,当时给出了能计算出db_pscode的利用工具。db_pscode是安装的时候随机生成的一个字符串常量,保存在配置文件里。4月22日,官方发布了新版本,改进了程序安装时候生成db_pscode的方法,"修复了"该漏洞。其实官方只是防住了当时的那个exp,并没有从根本上防住漏洞。22日之前是32位的md5hash字符串,这次长度变的不固定可以是1-39位的字符串,但是依然可以逆向出来,这里还是以后台绕过的方法来利用这个漏洞。
先看一下EspCMS后台的验证流程
管理的主界面important类的构造函数:
//adminsoft/management.php
class important extends connector {
function important() {
$this->softbase(true); //构造函数调用了父类中的softbase函数,softbase函数又调用了admin_purview函数来验证登录状态
}
---
//父类 connector中的softbase函数
// public/class_connector.php
class connector {
function softbase($admin_purview = false) {
header("Content-Type: text/html; charset=utf-8");
$this->dbmysql();
$this->commandinc();
$this->systemfile();
$this->cachedb();
if ($admin_purview) {
$this->admin_purview(); //这里会验证管理员是否已经登录
$this->sitelng = $this->getlng();
$action = $this->fun->accept('action', 'R');
if (in_array($action, $this->esp_powerlist) && !in_array('all', $this->esp_powerlist)) {
exit('Permissions errors'); //$this->esp_powerlist权限列表 这里设置成all就ok了
}
}
.....
// public/class_connector.php
function admin_purview() {
if ($this->fun->accept('archive', 'R')