### 简要描述: 又到周末。 ### 详细说明: 刚从官网上面下载下来的。 plugins\phpdisk_client\client_sub.php 我看了下这目录下的其他几个文件 在iconv后都调用了escape函数来转义 但是这个没有。 造就了注入。 ``` $agent = $_SERVER['HTTP_USER_AGENT']; if($agent!='phpdisk-client'){ exit('<a href="http://faq.phpdisk.com/search?w=p403&err=code" target="_blank">[PHPDisk Access Deny] Invalid Entry!</a>'); } $u_info = trim(gpc('u_info','P','')); parse_str(pd_encode(base64_decode($u_info),'DECODE')); // checked username and pwd... /*$username = trim(gpc('username','GP','')); $password = trim(gpc('password','GP',''));*/ $username = is_utf8() ? $username : convert_str('utf-8','gbk',$username); $password = is_utf8() ? $password : convert_str('utf-8','gbk',$password); $userinfo = $db->fetch_one_array("select userid from {$tpf}users where username='$username' and password='$password'"); if(!$userinfo){ $str = '网盘登录出错:用户名或密码不正确,请重新输入'; $str = is_utf8() ? convert_str('utf-8','gbk',$str) : $str; echo $str; }else{ $uid = (int)$userinfo[userid]; } ``` 首先验证了user agent 但是user...
### 简要描述: 又到周末。 ### 详细说明: 刚从官网上面下载下来的。 plugins\phpdisk_client\client_sub.php 我看了下这目录下的其他几个文件 在iconv后都调用了escape函数来转义 但是这个没有。 造就了注入。 ``` $agent = $_SERVER['HTTP_USER_AGENT']; if($agent!='phpdisk-client'){ exit('<a href="http://faq.phpdisk.com/search?w=p403&err=code" target="_blank">[PHPDisk Access Deny] Invalid Entry!</a>'); } $u_info = trim(gpc('u_info','P','')); parse_str(pd_encode(base64_decode($u_info),'DECODE')); // checked username and pwd... /*$username = trim(gpc('username','GP','')); $password = trim(gpc('password','GP',''));*/ $username = is_utf8() ? $username : convert_str('utf-8','gbk',$username); $password = is_utf8() ? $password : convert_str('utf-8','gbk',$password); $userinfo = $db->fetch_one_array("select userid from {$tpf}users where username='$username' and password='$password'"); if(!$userinfo){ $str = '网盘登录出错:用户名或密码不正确,请重新输入'; $str = is_utf8() ? convert_str('utf-8','gbk',$str) : $str; echo $str; }else{ $uid = (int)$userinfo[userid]; } ``` 首先验证了user agent 但是user agent 是我们可以控制的 无视他。 ``` function convert_str($in,$out,$str){ global $db; if(function_exists("iconv")){ $str = iconv($in,$out,$str); }elseif(function_exists("mb_convert_encoding")){ $str = mb_convert_encoding($str,$out,$in); } return $db->escape($str); } ``` 这里 也调用了escape转义了 但是 这里 利用宽字节来注入。 然后直接带入了查询。 造就了注入。 ### 漏洞证明: 这里没有输出。 需要盲注。 我直接把这里输出一下把。 证明一下可以注入就行了。 ``` $userinfo = $db->fetch_one_array("select userid from {$tpf}users where username='$username' and password='$password'"); print_r ($userinfo); ``` [<img src="https://images.seebug.org/upload/201404/12144742c3b6da02a7052ac7fef10a1532a3c598.jpg" alt="p1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201404/12144742c3b6da02a7052ac7fef10a1532a3c598.jpg)