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/ |- e* l( I$ ^
' m6 Z% \( r/ K3 z 复制代码- K) k V- T$ ?5 W( b
错误提示已经很明了了。我们看一下注入页面的代码(有删改):
$js_user = trim($_GET["js_user"]);
if($js_user){
$num = $db->num_rows("select userid from demo_b2b_member where user = '$js_user'");
if(!$num)
echo "<div class=tips3></div>";
else
echo "<div class=tips2>用户名已被注册</div>";
} ! f/ R) A( Z: O$ K' ^; d
( ^. g/ h6 v( F" Z$ i e 复制代码 8 E) E- i1 @! x以GET方式取值的变量js_user虽然没有过滤被直接带入了数据库执行,并且MySQL也执行了,但是并没有显示数据库的任何信息,而是判断是否符合0 h$ J8 W' _# P9 F, w$ {6 f# Z
那么我们先从union的盲注来看吧。* w3 f; f: G3 A
先看版本: