PHPYun /uploads/member/ajax.class.phpSQLインジェクションの脆弱性
PHPYunの紹介
PHPクラウドタレントマネジメントシステム、プロの採用ウェブサイトシステムオープンソースプログラム、PHPとMySQLデータベースで構築された効率的なタレントと企業の求人システムは、著作権を尊重するという前提でウェブマスターのウェブサイトプログラムを大いに満足させることができます二次開発を実施します。
脆弱性の原則
パラメータはフィルタリングされず、クエリ用のSQLステートメントに直接取り込まれるため、インジェクションの脆弱性が発生します。
脆弱性分析
/uploads/member/ajax.class.phpファイルを表示する
function getzphcom_action(){
if(!$_GET['jobid']){
$arr['status']=0;
$arr['content']=iconv("gbk","utf-8","您还没有职位,<a href='".Url("login",array(),"1")."'>请先登录</a>");
}else{
$row=$this->obj->DB_select_all("company_job","`id` in (".$_GET['jobid'].") and `uid`='".$this->uid."' and `r_status`<>'2' and `status`<>'1'","`name`");
$space=$this->obj->DB_select_all("zhaopinhui_space");
$zhaopinhui=$this->obj->DB_select_once("zhaopinhui","`id`='".intval($_GET['zid'])."'","`title`,`address`,`starttime`,`endtime`");
$com=$this->obj->DB_select_once("zhaopinhui_com","`zid`='".intval($_GET['zid'])."' and `uid`='".$this->uid."'");
foreach($row as $v){
$data[]=$v['name'];
}
$spaces=array();
foreach($space as $val){
$spaces[$val['id']]=$val['name'];
}
$cname=@implode('、',$data);
$arr['status']=1;
$arr['content']=iconv("gbk","utf-8",$cname);
$arr['title']=iconv("gbk","utf-8",$zhaopinhui['title']);
$arr['address']=iconv("gbk","utf-8",$zhaopinhui['address']);
$arr['starttime']=iconv("gbk","utf-8",$zhaopinhui['starttime']);
$arr['endtime']=iconv("gbk","utf-8",$zhaopinhui['endtime']);
$arr['sid']=iconv("gbk","utf-8",$spaces[$com['sid']]);
$arr['bid']=iconv("gbk","utf-8",$spaces[$com['bid']]);
$arr['cid']=iconv("gbk","utf-8",$spaces[$com['cid']]);
}
echo json_encode($arr);
}
上記のコードスニペットを分析します。
$row=$this->obj->DB_select_all("company_job","`id` in (".$_GET['jobid'].") and `uid`='".$this->uid."' and `r_status`<>'2' and `status`<>'1'","`name`");
$ _GET ['jobid']のフィルタリングがないことがわかります。
引き続きDB_select_all()関数をフォローアップし、/ uploads / app / public /action.class.phpファイルを確認してください。
function DB_select_all($tablename, $where = 1, $select = "*",$special='') {
$cachename=$tablename.$where;
if(!$row_return=$this->Memcache_set($cachename)){
$row_return=array();
if($this->siteadmindir&&$special==''){
$where = $this->site_fetchsql($where,$tablename);
}
$SQL = "SELECT $select FROM `" . $this->def . $tablename . "` WHERE ".$where;
$query=$this->db->query($SQL);
while($row=$this->db->fetch_array($query)){
$row_return[]=$row;}
$this->Memcache_set($cachename,$row_return);
}
return $row_return;
}
$ _GET ['jobid']にはまだフィルタリングがないことがわかります。
したがって、最後のSQLステートメントは次のようになります。
SELECT `name` FROM `phpyun_company_job` WHERE `id` in (可控) and `uid`='1' and `r_status`<>'2' and `status`<>'1'
360wafは受信したパラメーター、一重引用符、二重引用符、英語の括弧が中国語の括弧を変更し、キーワードselect、update、delete、insert、/ ** /をエスケープするため、これらは360によってインターセプトされるため、次を使用できます。 Xorは、SQLインジェクションの脆弱性をバイパスして実行します