Friday, April 26, 2013

Cracking the 1Password Master Password

[EDITED 27/08/2013 - Please note the file download below may have missing DLL problems. Please download this version of 1pass2hashcat.exe to extract the hash which should work on ALL Windows versions]

It has become apparent in recent weeks that obtaining the 1Password Master Password is possible. This is due not only to an understanding of how 1Password stores the data but also with a new feature in Hashcat (closed beta for now) that allows you to crack 1Password hashes. 

Firstly, 1Password is correct when they say that they do not store the master password. However, as with any form of access control, they store other data that is used to verify the password you entered as being the master password. It is with this data that one can crack a 1Password master password.

The below demonstration is for educational purposes only. 
I take no responsibility for how this tool is used.
Please use it only for data which you are authorized to access!

Step 1

We need to obtain the relevant information from the file that 1Password uses to store the validation hashes, iteration numbers and actual salt data etc. 

In Windows this file is stored in encryptionKeys.js in the primary 1Password directory.

Once we have that, we can retrieve the following information we need - the iterations, salt and verifier hash -note that this requires some calculation and conversion. 

I've built a utility to do that for us; called 1pass2hashcat.exe (click it to download it)

Lets first do a test to make sure our file is ok and our required data comes out ok:

mirage:~ rurapenthe$ ./1pass2hashcat.exe encryptionKeys.js -t
Entering self-test mode..
Checking computational arrangement..
Success! Salt is 16 bytes, Hash is 2080 bytes.
mirage:~ rurapenthe$ 

So we can see that our file is OK. We converted and extracted a salt and hash and iterations and the numbers checked-out.

Step 2

Now we need to generate our actual output data from hashcat. If i re-run the program without the -t it will output the data we need:

mirage:~ rurapenthe$ ./1pass2hashcat.exe encryptionKeys.js
mirage:~ rurapenthe$ 

Excellent, we have what we need. Our iterations:salt:hash to be used in Hashcat to find our master password. 

As of the current version of 1pass2hashcat the hash is automatically output to 1pass.hash in the current directory.

Step 3

Now we run Hashcat, along with our hash file and against our wordlist and lets see what happens:

[email protected]:~/Cracking/oclHashcat-plus-0.15$ ./oclHashcat-plus64.bin -m 6600 1pass.hash ../NewWordlists/rockyou.txt 

clHashcat-plus v0.15 by atom starting...

Hashes: 1 total, 1 unique salts, 1 unique digests
Bitmaps: 8 bits, 256 entries, 0x000000ff mask, 1024 bytes
Rules: 1
Workload: 16 loops, 8 accel
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c
Device #1: Cayman, 1024MB, 850Mhz, 22MCU
Device #2: Cayman, 512MB, 850Mhz, 22MCU
Device #3: Cypress, 512MB, 850Mhz, 20MCU
Device #4: Cypress, 512MB, 850Mhz, 20MCU
Device #1: Kernel ./kernels/4098/m6600.Cayman_1084.4_1084.4.kernel (896456 bytes)
Device #2: Kernel ./kernels/4098/m6600.Cayman_1084.4_1084.4.kernel (896456 bytes)
Device #3: Kernel ./kernels/4098/m6600.Cypress_1084.4_1084.4.kernel (865744 bytes)
Device #4: Kernel ./kernels/4098/m6600.Cypress_1084.4_1084.4.kernel (865744 bytes)

Cache-hit dictionary stats ../NewWordlists/rockyou.txt: 1299888 bytes, 142647 words, 142647 keyspace

WARN: ADL_Overdrive5_FanSpeedInfo_Get(): -1

Session.Name...: oclHashcat-plus
Status.........: Cracked
Input.Mode.....: File (../NewWordlists/rockyou.txt)
Hash.Target....: 1pass.hash
Hash.Type......: 1Password
Time.Started...: Fri Apr 26 14:35:48 2013 (4 secs)
Speed.GPU.#1...:    47176 H/s
Speed.GPU.#2...:    35135 H/s
Speed.GPU.#3...:        0 H/s
Speed.GPU.#4...:        0 H/s
Speed.GPU.#*...:    82312 H/s
Recovered......: 1/1 (100.00%) Digests, 1/1 (100.00%) Salts
Progress.......: 141839/142647 (99.43%)
Rejected.......: 1/141839 (0.00%)
HWMon.GPU.#1...:  0% Util, 47c Temp, N/A Fan
HWMon.GPU.#2...:  0% Util, 45c Temp, N/A Fan
HWMon.GPU.#3...:  0% Util, 53c Temp, N/A Fan
HWMon.GPU.#4...:  0% Util, 55c Temp, N/A Fan

As you can see, Hashcat cracked our password! :-)

Lets type that into 1Password and see what happened....

Yay! 1Password has been unlocked.


The moral of the story is simple and applies to any passwords you are ever required to use : Set a strong and long password! 

I again wish to iterate this blog post is for educational purposes and the tool is not to be used for any illegal activities or gaining access to any data you are not fully authorized to access. 

-Dimitri AKA Rurapenthe
Find me on #intern0t or #hashcat on Freenode 
or @Bitcrack_cyber on Twitter
(c) 2013 Bitcrack Cyber Security Pty Ltd