Weblogic 3DES decryption

Source: Internet
Author: User

When I encountered a problem with a JSP site, I found that the password was encrypted by finding the database configuration file and had a hard time working for a day. Today, my friends in the group were decrypted, but I also studied it myself, the main reason is that the installation package of Weblogic is too large, and I have never touched on this, so I want to find someone to solve it for convenience. after someone else solves the problem, it seems that learning how to solve it is the focus.

First download the installation package: http://download2.bea.com/pub/platform/92/server920_win32.exe (use thunder download)

To avoid any problems, use the Windows installation package. The version is the same as that of the website.

The data source configuration file HKS *****-jdbc. xml and SerializedSystemIni. dat have been downloaded to the local device. Wait for more than an hour to drag down the installation package, and then install the package:

After a period of installation is complete, place the configuration file under "C: \ bea \ weblogic92 \ samples \ domains \ wl_server \ config \ jdbc" and place the key file in "C: \ bea \ weblogic92 \ samples \ domains \ wl_server \ security ", and then use the following WebLogicDecryptor. class cracking: WebLogicDecryptor. the source code of java is as follows:

import java.util.*;import java.io.*;import javax.xml.parsers.*;import javax.xml.xpath.*;import org.w3c.dom.*;import weblogic.security.internal.*; // requires weblogic.jar in the class pathimport weblogic.security.internal.encryption.*; public class WebLogicDecryptor {private static final String PREFIX = "{3DES}";private static final String XPATH_EXPRESSION = "//node()[starts-with(text(), '"+ PREFIX + "')] | //@*[starts-with(., '" + PREFIX + "')]";private static ClearOrEncryptedService ces; public static void main(String[] args) throws Exception {if (args.length < 2) {throw new Exception("Usage: [domainDir] [configFile]");} ces = new ClearOrEncryptedService(SerializedSystemIni.getEncryptionService(new File(args[0]).getAbsolutePath()));File file = new File(args[1]);if (file.getName().endsWith(".xml")) {processXml(file);} else if (file.getName().endsWith(".properties")) {processProperties(file);} } private static void processXml(File file) throws Exception {Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file);XPathExpression expr = XPathFactory.newInstance().newXPath().compile(XPATH_EXPRESSION);NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);for (int i = 0; i < nodes.getLength(); i++) {Node node = nodes.item(i);print(node.getNodeName(), node.getTextContent());} } private static void processProperties(File file) throws Exception {Properties properties = new Properties();properties.load(new FileInputStream(file));for (Map.Entry p : properties.entrySet()) {if (p.getValue().toString().startsWith(PREFIX)) {print(p.getKey(), p.getValue());}}} private static void print(Object attributeName, Object encrypted) {System.out.println("Node name: " + attributeName);System.out.println("Encrypted: " + encrypted);System.out.println("Decrypted: " + ces.decrypt((String) encrypted)+ "\n");}}
First open CMD, then pushd to the "C: \ bea \ weblogic92 \ samples \ domains \ wl_server" directory, and then import the environment variable "setExamplesEnv. cmd", as shown below:

Then compile WebLogicDecryptor. java (you can download it here: http://www.bkjia.com/uploadfile/2013/0501/20130501110556618.rar

), Compile and execute the following command:

Java WebLogicDecryptor C: \ bea \ weblogic92 \ samples \ domains \ wl_server C: \ bea \ weblogic92 \ samples \ domains \ wl_server \ config \ jdbc \ HKS516-8106-jdbc.xml

Command Format: Usage: [domainDir] [configFile]

The final result is shown in the figure above:

The password is very weak and the authentication is complete.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.