来源:自学PHP网 时间:2015-04-16 23:15 作者: 阅读:次
[导读] 淘宝某站源码泄露及SQL注入分析拿下淘宝某站源码,分析sql注入漏洞及绕过svn导致源码泄露:http: ip taobao com svn entries拿下源码接下来分析源码:1 敏感信息泄露,数据库信息:2 sql注入分...
淘宝某站源码泄露及SQL注入分析拿下淘宝某站源码,分析sql注入漏洞及绕过svn导致源码泄露:http://ip.taobao.com/.svn/entries 接下来分析源码: 2.sql注入分析 <?php require_once("./common.php"); require_once('../runtime_start.php'); if (!is_user_login()) { response_data(FAILED, 'user not login'); exit(1); } $page = 1; $rows = 1; if (!isset($_REQUEST['page'])) { response_data(FAILED, 'no page param.'); exit(1); } else { $page = $_REQUEST['page']; } if (!isset($_REQUEST['rows'])) { response_data(FAILED, 'no rows param.'); exit(1); } else { $rows = $_REQUEST['rows']; } $wangwang_id = $_COOKIE['wangwang_id']; $start = $rows * ($page-1); $len = $rows; $con = init_db(); if (!$con) { response_data(FAILED, 'database error'); echo "conn error\n"; exit(1); } $query_sql = "SELECT SQL_CALC_FOUND_ROWS ip, country, region, city, county, isp, feedback_type, feedback_date FROM user_feedback_item WHERE wangwang_id='".addslashes($wangwang_id). "' order by id desc LIMIT ".intval($start).", ".intval($len); $res = mysql_query($query_sql, $con); if ($res) { $rows = array(); while($temp = mysql_fetch_array($res, MYSQL_ASSOC)) { $rows[] = $temp; } $item_num = 0; $ttl_sql = "SELECT FOUND_ROWS() as item_num "; $ttl_rlt = mysql_query($ttl_sql, $con); if($ttl_rlt && $ttl_row = mysql_fetch_array($ttl_rlt, MYSQL_ASSOC)) { $item_num = $ttl_row['item_num']; mysql_free_result($ttl_rlt); } $items = array(); $items['total'] = ceil($item_num/$len); $items['rows'] = $rows; $items['records'] = $item_num; $items['page'] = $page; response_data(SUCCESS, $items); mysql_free_result($res); } else { response_data(FAILED, 'database error'); } mysql_close($con); ?>
$query_sql = "SELECT SQL_CALC_FOUND_ROWS ip, country, region, city, county, isp, feedback_type, feedback_date FROM user_feedback_item WHERE wangwang_id='".addslashes($wangwang_id). "' order by id desc LIMIT ".intval($start).", ".intval($len);
额。。。修改了wangwang_id导致is_user_login()判断用户未登录。伤心 //判断用户是否登陆 function is_user_login() { return !empty($_COOKIE['_t']) && !empty($_COOKIE['wangwang_id']) && get_passport_token($_COOKIE['wangwang_id']) == $_COOKIE['_t']; }
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com