这篇文章是我近期在审计一套 CMS 的时候顺便写的。
一般来讲程序对于输入字符长度进行限制的方法主要分两种,一种是前端的长度限制,这种的绕过只需要修改前端源码即可,或者本地构造一个表单。
本次审计的这套 CMS 存在一个 XSS 漏洞,由于日志入库验证不严格导致存在该漏洞,只需要尝试登陆即可写入 payload 。
$uid = 0;
$cfrom = $this->method->request('cfrom', $cfrom);
$token = $this->method->request('token');
$device= $this->method->request('device', $device);
$ip = $this->method->request('ip', $this->method->ip);
$web = $this->method->request('web', $this->method->web);
$cfroar= explode(',', 'pc,reim,weixin,appandroid,appiphone,mweb');
if(!in_array($cfrom, $cfroar))return 'not found cfrom';
if($user=='')return '用户名不能为空';
if($pass==''&&strlen($token)<8)return '密码不能为空';
$user = addslashes(substr($user, 0, 20));
$pass = addslashes($pass);
$logins = '登录成功';
$msg = '';
$fields = '`pass`,`id`,`name`,`user`,`face`,`deptname`';
$arrs = array(
'user' => $user,
'status|eqi' => 1,
'type|eqi' => 1,
'state|neqi' => 5
);

最低0.47元/天 解锁文章
516

被折叠的 条评论
为什么被折叠?



