WebLogic 12c Password Decryption
Create a file called decryptpasswd.py with following content:
import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService
def decrypt(domainHomeName, encryptedPwd):
domainHomeAbsolutePath = os.path.abspath(domainHomeName)
encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
clear = ces.decrypt(encryptedPwd)
print "Decrypted Password:" + 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 <DOMAIN_HOME> <ENCRYPTED_PASSWORD>"
print " Example:"
print "java weblogic.WLST decryptPassword.py <domain_path> <encrypted password>"
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise
In order to decrypt password just set the environment:
[oracle@wls-test bin]$. /u01/oracle/fmw/wlserver_10.3/server/bin/
Execute command for decrypting password like:
[oracle@wls-test bin]$ java weblogic.WLST decryptpasswd.py /u01/oracle/fmw/user_projects/domains/wls_domain {AES}99WmgRF0301GdzJGwOky7HLk4pBKSEguF1mlAvH4iG0\=
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Decrypted Password:<PASSWORD>