作者:q1ur3n
中易广告联盟系统(ZYADS) sql注入和本地包含漏洞解析
- <?
- include_once("top.php");
- $newsid = intval($_GET['id']);
- $to_type = addslashes($_GET['type']);
- if ($to_type=='index')
- {
- $to_type_s =" and to_type=1";
- }
- if ($to_type=='webuser')
- {
- $to_type_s =" and to_type!=3";
- }
- if ($to_type=='webadver')
- {
- $to_type_s =" and to_type!=2";
- }
- $newssql = 'select * from zyads_news WHERE `id` =\'' . $newsid . '\'
- '.$to_type_s.'';
- $newsre=$db->query($newssql);
- $newsrow = $db->fetch_array($newsre);
- if (emptyempty($newsrow)){
- zyads_message('zyads_news');
- }
- ?>
可以看到$to_type没定义或者不等于index,webuser,webadver的话 那么$to_type_s是没有定义的
这时候我们就可以提交一个$to_type_s变量来进行sql注入。简单的注入,呵呵。
在/code/adview_cpa_html.php 1-46行
- <?php
- /*********************/
- /* */
- /* Version : 5.1.0 */
- /* Author : RM */
- /* Comment : 071223 */
- /* */
- /*********************/
- _obfuscate_JQYdYn1jfBI