1. Set Required CLASSPATH

[oracle@machine-1 ]$ export CLASSPATH=/u01/app/oracle/product/j2ee/wlserver/server/lib/weblogic.jar:/u01/app/oracle/product/j2ee/wlserver/modules/com.bea.cie.config_5.2.0.0.jar:/u01/app/oracle/product/j2ee/wlserver/modules/features/wlst.wls.classpath.jar

2. Create a file decryptPassword.py and copy following contents

#=======================================================================================
# This Script decrypts WebLogic passwords if you forget them
#
# Usage: 
#      wlst decryptPassword.py <ABSOLUTE_DOMAIN_PATH> <ENCRYPTED_PASSWORD>
#
#=======================================================================================
import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService

def decrypt(absoluteDomainPath, encryptedPwd):
    domainHomeAbsolutePath = os.path.abspath(absoluteDomainPath)
    encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
    ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
    clear = ces.decrypt(encryptedPwd)
    print "RESULT:" + clear

try:
    if len(sys.argv) == 3:
        decrypt(sys.argv[1], sys.argv[2])
    else:
        print "INVALID ARGUMENTS"
        print " Usage: java weblogic.WLST decryptPassword.py <ABSOLUTE_DOMAIN_PATH> <ENCRYPTED_PASSWORD>"
        print " Example:"
        print "    java weblogic.WLST decryptPassword.py /projects/domains/domain_name {AES}819R5h3JUS9fAcPmF58p9Wb3syTJxFl0t8NInD/ykkE="
except:
    print "Unexpected error: ", sys.exc_info()[0]
    dumpStack()
    raise

 

3. Execute script

Example.

[oracle@machine-1 ]$ /u01/app/jdk1.8.0_66/bin/java weblogic.WLST decryptPassword.py /projects/domains/osb_domain/ {AES}ohjWoegMTUUY45UjyLMjUKNWFOpFMQ7EWzgyNZYKHwY=

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

RESULT:admin1
[oracle@machine-1 ]$

 

4. To Encrypt Password for using it in config.xml

java -Dweblogic.RootDirectory=/projects/domains/osb_domain/  weblogic.security.Encrypt encryptMeNOW