Advertisements
RSS

Tag Archives: SQLDeveloper

How to retrieve stored password from Oracle SQLdeveloper

>This is mainly a reminder for myself. Last week I forgot a schema password but my SQL developer had it stored in it’s configuration.

So I found this post. All credits to kornelissietsma and passshok.

<Reference name="my Database" className="oracle.jdeveloper.db.adapter.DatabaseProvider" xmlns="">      <Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>      <RefAddresses>        <StringRefAddr addrType="password">        <Contents>05A1B2C3D4E5F6A7B939B5E1234A6E94D76745678724ABCD12</Contents>        </StringRefAddr>

The length of the hash is 50 hex characters.
The first byte is constant: 05
The next 8 bytes represent the randomly generated secret key (for the DES cipher): A1B2C3D4E5F6A7B9
The remaining bytes are the encrypted password: 39B5E1234A6E94D76745678724ABCD12

import oracle.jdevimpl.db.adapter.DatabaseProviderHelper;

class Decode
{
  String pass = "";
  public Decode()
  {
    pass = DatabaseProviderHelper.comingIn("05xxxxxxxxx");
    System.out.println(pass);
  }

public static void main(String[] args)
{
  new Decode();
}
  }

Then compile:
javac -classpath .;D:\Oracle\sqldeveloper-2.1.1.64.45\modules\oracle.adf.model_11.1.1\db-ca.jar;D:\Oracle\sqldeveloper-2.1.1.64.45\sqldeveloper\extensions\oracle.datamodeler\ojmisc.jar sqldeveloper_hash_decode.java

And run:
java -classpath .;D:\Oracle\sqldeveloper-2.1.1.64.45\modules\oracle.adf.model_11.1.1\db-ca.jar;D:\Oracle\sqldeveloper-2.1.1.64.45\sqldeveloper\extensions\oracle.datamodeler\ojmisc.jar Decode

And voila the result a cleartext password.

Advertisements
 
11 Comments

Posted by on 24-12-2010 in Oracle, SQLDeveloper

 

Tags: ,