Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,151 Members 49,419 Now Online
XDA Developers Android and Mobile Development Forum

[Tool] WhatsApp Key/DB Extractor | CRYPT7 | NON-ROOT

Tip us?
 
TripCode
Old
(Last edited by TripCode; 19th July 2014 at 05:09 PM.) Reason: Added unofficial fork
#1  
Member - OP
Thanks Meter 24
Posts: 56
Join Date: Mar 2014
Prompt [Tool] WhatsApp Key/DB Extractor | CRYPT7 | NON-ROOT

SUMMARY:

The purpose of this script is to provide a method for WhatsApp users to extract their cipher key on NON-ROOTED Android devices. The cipher key is required to decrypt WhatsApp CRYPT6 and CRYPT7 backup files. This script works by hooking into the USB backup feature on Android 4.0 or higher. It will NOT work with earlier Android versions or on devices where this feature has been deliberately disabled by the manufacturer. The cipher key can be used with WhatCrypt, both on the Website (online decryption / exportation) and with the Android App (offline decryption / recryption). Other apps and websites may also support WhatsApp cipher keys. It should be noted that WhatsApp cipher keys can roll (update) periodically. If this happens then you will need to repeat the instructions contained within this file in order to extract the latest cipher key. This script will also extract the latest UNENCRYPTED WhatsApp Message Database (msgstore.db) and Contacts Database (wa.db).

In addition to the above. A copy of the cipher key will also be pushed to the WhatsApp Database directory on the device itself and contained within a file called ".nomedia". The reason for this is to allow Android Developers a unified method in which they can offer their app users WhatsApp Decryption for those willing to run this script.


PREREQUISITES:
  1. O/S: Windows Vista, Windows 7 or Windows 8
  2. Java - If not installed: Download Java
  3. ADB (Android Debug Bridge) Drivers - If not installed: ADB Installer
  4. USB Debugging* must be enabled on the target device. Settings -> Developer Options -> (Debugging) USB debugging
  5. Android device with Android 4.0 or higher
*= If you cannot find Developer Options then please go to: Settings -> About phone/device and tap the Build number multiple times until you're finally declared a developer.


INSTRUCTIONS:
  1. Extract "WhatsAppKeyExtract.zip" on your computer maintaining the directory structure.
  2. Browse to the extracted folder and click on "WhatsAppKeyExtract.bat".
  3. Connect your device via USB**, unlock your screen and wait for "Full backup" to appear.
  4. Leave the password field blank and tap on "Back up my data".
  5. The "extracted" folder will now contain your "whatsapp.key", "msgstore.db" and "wa.db".

** = If you have never used USB Debugging before, you may also need to verify the fingerprint.


CHANGELOG:

1.1 - Removed Java check, due to some users reporting that they're getting stuck in an install loop.
1.0 - Initial release.


GITHUB FORK / *NIX VARIANT:

Not my hub, but many thanks to Abinash Bishoyi who has created an unofficial fork on GitHub. He has added a *nix variant "sh" script and made some modifications for users who have experienced problems with ADB on Android 4.4.3. He has also added support for Android L. Kudos to him.

Link: https://github.com/AbinashBishoyi/Wh...y-DB-Extractor


COMPATIBLE APPS:
  1. WhatCrypt Tool 1.3+
  2. WhatsApp Tri-Crypt 1.2+

The apps listed above have been confirmed working with WhatsApp Key/DB Extractor. I.E. They will either look for and use the static cipher key that this tool will copy to: "sdcard/WhatsApp/Databases/.nomedia" as an alternative decrypt/recrypt method, or will allow you to manually set the path to the key file. If you wish your app to be added to this list, then please let me know and I will add your app (pending verification / confirmation).


AUTHOR: TripCode
THANKS: dragomerlin for Android Backup Extractor, Snoop05 for ADB Installer and Abinash Bishoyi for GitHub fork.
Attached Thumbnails
Click image for larger version

Name:	WhatsAppKeyDBExtractorSC.png
Views:	3667
Size:	12.2 KB
ID:	2782960  
Attached Files
File Type: zip WhatsAppKeyExtract.zip - [Click for QR Code] (3.75 MB, 5193 views)
The Following 4 Users Say Thank You to TripCode For This Useful Post: [ Click to Expand ]
 
droopyar
Old
#2  
Senior Member
Thanks Meter 10
Posts: 102
Join Date: Jun 2010
Thumbs up alternatives

Yes, this is a normal backup method. There are automatic tools that do the same without using PC, just on device side.

Apart from normal ADB method, you could use ECLIPSE for that, using the memory module, you could transfer files from and in.

If you have physical access to the device, there are many solutions.

regards.
 
TripCode
Old
#3  
Member - OP
Thanks Meter 24
Posts: 56
Join Date: Mar 2014
Quote:
Originally Posted by droopyar View Post
Yes, this is a normal backup method. There are automatic tools that do the same without using PC, just on device side.

Apart from normal ADB method, you could use ECLIPSE for that, using the memory module, you could transfer files from and in.

If you have physical access to the device, there are many solutions.

regards.
The only way to access private application files (such as a WhatsApp's cipher key) without root is the ADB method. You can backup some files on the device without a PC (APK's etc...), but there is currently no way to access private files and folders. All the "My Big Fat Backup" style apps and tools will either require root or ADB. Eclipse also utilizes ADB. Basically, device side backups of application data require root. There are no other alternatives to this. If there was, then Android would be too infeasible and insecure as a viable operating system. Physical access translates into only two solutions. 1.) The ability to root and 2.) The ability to utilize ADB (Eclipse, Bats, Exe's doing nothing more than calling a simple command line). Of course if you are aware of a 3rd method (disregarding the user interface) and is not based on root or ADB then please feel free to share.
 
MiaNet
Old
(Last edited by MiaNet; 5th June 2014 at 11:43 AM.)
#4  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jun 2014
Thanks for this tool!
I've just tried to use it, but it installs the java constantly (while java is properly installed on computer as other applications uses it without any problem )
By any chance, do you have any idea how to pass that?
Thanks!!
Mia
PS I got JDK installed and still not working
 
TripCode
Old
(Last edited by TripCode; 5th June 2014 at 04:01 PM.) Reason: Added additional information
#5  
Member - OP
Thanks Meter 24
Posts: 56
Join Date: Mar 2014
Quote:
Originally Posted by MiaNet View Post
I've just tried to use it, but it installs the java constantly (while java is properly installed on computer as other applications uses it without any problem )
By any chance, do you have any idea how to pass that?
The bat file automatically checks for the presence of java.exe on your system. If it's not found then it starts the install. It would appear that for some reason it's not finding Java and hence why you're stuck in this loop. Please find attached a bat file without the Java check. Just put it in the same folder as the original and run this one instead. Let me know how you get on. Java also needs to be callable from the command line. To check this is working you should click on Run... within Windows, type cmd, click OK and type "java -version" (without quotes) and press Enter. This will confirm java is in the command path and print out your JRE build number. I have also updated the release in the OP and removed the Java check, as I have had a couple of similar reports of the loop issue.

Thanks again.
Attached Files
File Type: zip WhatsAppKeyExtractNoJavaCheck.zip - [Click for QR Code] (832 Bytes, 495 views)
The Following User Says Thank You to TripCode For This Useful Post: [ Click to Expand ]
 
mesho_alaa
Old
#6  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Jun 2014
Default still showing this message attached

Quote:
Originally Posted by TripCode View Post
The bat file automatically checks for the presence of java.exe on your system. If it's not found then it starts the install. It would appear that for some reason it's not finding Java and hence why you're stuck in this loop. Please find attached a bat file without the Java check. Just put it in the same folder as the original and run this one instead. Let me know how you get on. Java also needs to be callable from the command line. To check this is working you should click on Run... within Windows, type cmd, click OK and type "java -version" (without quotes) and press Enter. This will confirm java is in the command path and print out your JRE build number. I have also updated the release in the OP and removed the Java check, as I have had a couple of similar reports of the loop issue.

Thanks again.
Still showing the attached message
Attached Thumbnails
Click image for larger version

Name:	Failed.png
Views:	960
Size:	13.2 KB
ID:	2782486  
 
TripCode
Old
#7  
Member - OP
Thanks Meter 24
Posts: 56
Join Date: Mar 2014
Quote:
Originally Posted by mesho_alaa View Post
Still showing the attached message
This sounds to me like you need to update your PATH Environment variable with the directory in which java is installed.

Open up a DOS window and type: "where java" (without quotes) to determine possible locations.

If it's located in: "C:\Windows\System32" then the following code should suffice:

Code:
Select Code
set PATH=%PATH%;C:\Windows\System32
If it's located in: "C:\Program Files\Java\jre7\bin" then:

Code:
Select Code
set PATH=%PATH%;C:\Program Files\Java\jre7\bin
The above needs to be added to the bat script BEFORE Java is called. You can edit the bat script by opening it with Notepad.

Alternatively, you could permanently update the PATH Environment (probably a better method).

To do this you would: Right click on "Computer" or "My Computer", within Windows Explorer, choose "Properties", click on the "Advanced system settings" and/or the "Advanced" tab, then click on the "Environment Variables" button. Select the "PATH" line, click the "Edit" button, and add the relevant directory to the end of any text that exists for PATH, prefixing the java path with a ";" (semicolon) if this line already contains other string paths. If PATH does not exist then you will need to add it. Sorry this paragraph is a little double-dutch (trying to cater for multiple versions of Windows).
 
MiaNet
Old
#8  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jun 2014
Many thanks! I'll test when home and let you know.
Just to let know, the path command do not fix the prior version with Java check as I first thought this might be the problem.
Thanks!
Mia
 
McGiver93
Old
#9  
McGiver93's Avatar
Senior Member
Thanks Meter 58
Posts: 365
Join Date: Nov 2009
Location: Villarotta

 
DONATE TO ME
Could even be use with ADB from phone to phone? without using the pc? Or I must install the app on the phone and do it offline?
-------
Current: HTC One S with Broken Rear Camera
_______________________________________________

Before: HTC Buzz Wildfire with Cyanogenmod 7.2 RC1
_______________________________________________

First One: HTC Touch Diamond

-------
 
MiaNet
Old
#10  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jun 2014
I have find my way! Re-installed Java, manually clicked on java.exe stored in Java folder in Program files (or Program files (x86) ) I've clicked on Javacpl as well and enabled all options, not sure if this is necessary though.
I've then rerun the program without Java check (the Java check one is bugging now) and was able to do the back up.
Thanks!!
Best regards,
Melanie

Tags
crypt, crypt5, crypt6, crypt7, whatsapp
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes