Steps to create a script and decrypt the password encrypted(3DES)
1. Copy the password from the config.xml file $BEA_MIDDLEWARE_DOMAIN/user_projects/domains/
2. Change the directory in the terminal to the weblogic domain directory/security
"cd $BEA_MIDDLEWARE_DOMAIN/user_projects/domains/
3. Create a java script file using the vi editor command "$vi SsmDecrypt.java"
Copy and paste the below code
***************************************************************
import weblogic.security.internal.SerializedSystemIni;
import weblogic.security.internal.*;
import weblogic.security.internal.encryption.*;
public class SsmDecrypt
{
public static EncryptionService es = null;
public static ClearOrEncryptedService ces = null;
public static void main(String args[])
{
String s = null;
if(args.length == 0)
System.out.println("Enter Password");
else
if(args.length == 1)
s = args[0];
else
System.err.println("Usage: java Decrypt [ password ]");
es = SerializedSystemIni.getExistingEncryptionService();
if(es == null)
{
System.err.println("Unable to initialize encryption service");
return;
}
ces = new ClearOrEncryptedService(es);
if(s != null)
System.out.println("\nDecrypted Password is:"+ces.decrypt(s));
}
}
*************************************************************
4. Execute the below command along with the encrypted password
$java SsmDecrypt <{3DEX}password>
Example
$java SsmDecrypt {3DES}ChApor4ZjYQ=
Output
Decrypted Password is:xxxxxxxx
No comments:
Post a Comment