It is possible to forget the passwords of the users in the DB Links created for the communication between Oracle databases. These users’ passwords can be identified. You can follow the steps below to find the password of the oracle db link user.
These steps apply to database version 11.2.0.2 and earlier created db links. In later versions, passwordx value cannot be decrypted if it is more than 50 characters.
Follow these steps in the database where the DB link is created.
First, let’s specify db links with passwordx value of 50 characters.
1 2 3 4 5 6 7 |
SQL> column name format a30 SQL> column userid format a30 SQL> select name, userid from sys.link$ where length(passwordx)=50; NAME USERID ------------------------------ ------------------------------ ORCL_LINK ORCL_LINK_USER |
Then, let’s find the encrypted password of this db link.
1 2 3 4 5 6 7 8 |
SQL> set lines 1000 SQL> column name format a30 SQL> column passwordx format a60 SQL> select name,passwordx from sys.link$ where name in ('ORCL_LINK'); NAME PASSWORDX ------------------------------ ------------------------------------------------------------ ORCL_LINK XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
Let’s find the clear text of the detected password. When you run the following procedure, you will see the clear text of the password in “Password: XXXXXXXXX”.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
SQL> SET SERVEROUTPUT ON SQL> DECLARE db_link_password VARCHAR2 (100); BEGIN db_link_password := 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; DBMS_OUTPUT.put_line ( 'Plain password: ' || UTL_RAW.cast_to_varchar2 ( DBMS_CRYPTO.decrypt (SUBSTR (db_link_password, 19), DBMS_CRYPTO.DES_CBC_PKCS5, SUBSTR (db_link_password, 3, 16)))); END; / Password : XXXXXXXXX PL/SQL procedure successfully completed. SQL> |