Sunday, August 14, 2016

Recover weblogic Admin password.

9:58 PM Posted by Dilli Raj Maharjan No comments

Go to OEM instance home. In my case /ssd/oracle/gc_inst is instance home.

cd /ssd/oracle/gc_inst1/

Change directory to user_projects/domains/GCDomain/servers/EMGC_ADMINSERVER/security/
and open file boot.properties.


[root@core gc_inst]# cd user_projects/domains/GCDomain/servers/EMGC_ADMINSERVER/security/
[root@core security]# cat boot.properties 
# Generated by Configuration Wizard on Thu Jun 23 11:59:29 NPT 2016
username={AES}gSDr8lmhI2OXWEXXXXXXXXXXX+ZOmnyOkOtaRUZmJo8=

password={AES}fUCumT2yS3YBWvXXXXXXXXXXXx0NkHtdaBytrg1fBE=









[oracle@core servers]$ pwd
/ssd/oracle/gc_inst/user_projects/domains/GCDomain/servers
[oracle@core servers]$

Note the username data value and password data value.

Create a java file that will decrypt the encrypted form of the password. I have created java file with name recoverpwd.java with content below.


[root@core security]# cat > /tmp/recoverpwd.java
public class recoverpwd {
 public static void main(String[] args)
 {
  System.out.println(
  new weblogic.security.internal.encryption.ClearOrEncryptedService(
  weblogic.security.internal.SerializedSystemIni.getEncryptionService(args[0]
   )).decrypt(args[1]));
  }
}













Compile java with following command


javac /tmp/recoverpwd.java 

ls /tmp/recoverpwd.class






Export oracle environment with following command


 . /ssd/oracle/gc_inst1/user_projects/domains/GCDomain/bin/setDomainEnv.sh 

Verify environment variables are set properly

echo $DOMAIN_HOME








Decrypt password with the java and the encrypted password.

cd /tmp/
java -cp $CLASSPATH:. recoverpwd \
$DOMAIN_HOME {AES}gSDr8lmhI2OXWEMpOmMLy3UkN+ZOmnyOkOtaRUZmJo8=







0 comments:

Post a Comment