Wednesday, May 17, 2023

Decrypt Oracle Weblogic password.

7:02 PM Posted by Dilli Raj Maharjan No comments


    Oracle WebLogic Server is a Java EE application server currently developed by Oracle Corporation. Oracle acquired WebLogic Server when it purchased BEA Systems in 2008. It is a chance that we may forget the WebLogic admin username and password. Following is the step-by-step guide to recovering the WebLogic admin user and password.


1. Set oms environment variables.

. oraenv <<< oms 

2. Changed directory to the GCDomain/bin

cd  /u01/app/oracle/gc_inst/user_projects/domains/GCDomain/bin/

ls -alh






3. The WebLogic settings are in the setDomainEnv.sh script file(setDomainEnv.cmd for Windows and setDomainEnv.sh for Linux). Execute the command below to set WebLogic environment variables.

./setDomainEnv.sh

4. The username and password are stored in encrypted format in the file boot.properties below. Search the file with the name. There may be multiple boot.properties files, but the required one is inside the security directory.

find /u01 -iname boot.properties

Choose the one with the security/boot.properties as in the screenshot below.

/u01/app/oracle/gc_inst/user_projects/domains/GCDomain/servers/EMGC_ADMINSERVER/security/boot.properties


5. WebLogic Scripting Tool (WLST) is a command-line scripting interface system administrators and operators use to monitor and manage WebLogic Server instances and domains. Execute wlst.sh inside the oracle_common/common/bin directory.

${ORACLE_HOME}/oracle_common/common/bin/wlst.sh

Type the following command to fetch the password.

Once you execute the wlst.sh the prompt will be like below. 

wls:/offline>

6. Execute the command one at a time. Make sure you replace the location of the boot.properties noted in the earlier step.

from weblogic.security.internal import BootProperties

BootProperties.load("<boot.properties location>", false)

prop = BootProperties.getBootProperties()

print "username: " + prop.getOneClient()

print "password: " + prop.getTwoClient()

The password was recovered successfully.

0 comments:

Post a Comment