来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] 注入出现在cycle_image php?phpdefine( IN_LOCK, true );define( INIT_NO_USERS, true );define( INIT_NO_SMARTY, true );require( includes init php );header( Content-type: text x...
注入出现在cycle_image.php
<?php define( "IN_LOCK", true ); define( "INIT_NO_USERS", true ); define( "INIT_NO_SMARTY", true ); require( "./includes/init.php" ); header( "Content-type: text/xml; charset=utf-8" ); header( "Expires: Fri, 14 Mar 1980 20:53:00 GMT" ); header( "Last-Modified: ".gmdate( "D, d M Y H:i:s" )." GMT" ); header( "Pragma: no-cache" ); $s = explode( "^", trim( $_GET['language'] ) );//用^分隔得到数组$s echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><bcaster>"; $sql = "select * from ".$site->table( "ad" )." where language_id=".$s[0]." and category='".$s[1]."' and type=0 and state=0 order by sort_order desc";//$s[0]没加单引号,无视gpc注入 $res = $db->getAllCached( $sql ); foreach ( $res as $row ) { if ( is_file( "upload/adfile/".$row['file'] ) ) { echo "<item item_url=\"".$_CFG['weburl']."/upload/adfile/".$row['file']."\" link=\"".$row['url']."\" />"; } } echo "</bcaster>"; ?>
修复方案:language接收的是个数组,对每个值遍历进行: |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com