博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sqli-labs ————less -26a
阅读量:171 次
发布时间:2019-02-28

本文共 905 字,大约阅读时间需要 3 分钟。

Less-26a

查看一下源代码:

查询语句:

$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";
过滤机制:
function blacklist($id){	$id= preg_replace('/or/i',"", $id);			//strip out OR (non case sensitive)	$id= preg_replace('/and/i',"", $id);		//Strip out AND (non case sensitive)	$id= preg_replace('/[\/\*]/',"", $id);		//strip out /*	$id= preg_replace('/[--]/',"", $id);		//Strip out --	$id= preg_replace('/[#]/',"", $id);			//Strip out #	$id= preg_replace('/[\s]/',"", $id);		//Strip out spaces	$id= preg_replace('/[\s]/',"", $id);		//Strip out spaces	$id= preg_replace('/[\/\\\\]/',"", $id);		//Strip out slashes	return $id;}

这一关与26关的区别在于,这一关中的SQL语句在构建的时候添加了一个括号,同时在SQL语句执行抛出错误后并不在前台页面输出。所以这里报错注入直接排除,不可以使用,但是我们可以使用联合查询。

这里我们可以使用')来闭合前面的(',之后在后面加入自己构造的SQL注入语句,同时在最后仍然需要闭合后面的')才可以,在这个过程中我们仍然需要绕过过滤机制,至于绕过的方法在上一节中已经有所说明了,这里不再重复了,下面给出一个简易payload:

http://192.168.11.136/sqli-labs/Less-26a?id=1')union%a0select%a01,user(),3||('1

你可能感兴趣的文章