??????sql???????????
???????????? ???????[ 2015/6/30 15:28:55 ] ?????????????
????1.PDO????????
??????????????????????е?sql??????????????壬??????????????????ж???
???????????????????
????1.1??????????????Σ????????????????????????ж?Ρ????仰???????????????????????????ж?Σ?????PDO??????????ó????????
????1.2??????????????????Я????????????????Ч???sql?????????????????????????????δ????????????????????????sql????????
????1.3??????pdo???????Ч??????
????1.3.1??limit???
????1.3.2:like%?%.????????????λ?????????????????????????????like??????????????????????%iloveyou%;
????2.????????????decode???Ρ????url???????
????????????????????????????????????????????????????????????????????á?
????http://drops.wooyun.org/tips/968
????3.???????????????????Щsql??????????urldecode???κ?)??????union??select??concat?????????????磬??Щsql??????????滻????????磺seSelectlect?????????select??????????????????select??
???????????????д?????sql?????????滻????????????????????????????????????????sql????????
publicfunctionremoveSql($keyword){
$temKeywords=urldecode(urldecode(trim($keyword)));
$sqlKeywords=array("/add/i"??"/(/"??"/)/"??"/alter/i"??"/update/i"??"/delete/i"??"/select/i"??"/and/i"??"/or/i"??"/between/i"??"/group/i"??"/drop/i"??"/from/i"??"/having/i"??"/order/i"??"/like/i"??"/change/i"??"/limit/i"??"/distinct/i"??"/'/"??"/"/"??"/%27/i"??"/0x27/i"??"/mid/i"??"/database()/i"??"/in/i"??"/concat/i"??"/char(.*?)/i"??"/%/"??"/union/i"??"/=/"??"/s+/");
$sqlReplacement="";
$resKeyword=preg_replace($sqlKeywords??$sqlReplacement??$temKeywords);
return$resKeyword;
}
??????????Щ??????????????sql??????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11