Skip to content

nfaurass/whatsapp-key-database-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Key & Database Extractor

Extract WhatsApp encryption keys and local message databases from non-rooted Android devices for backup analysis and message recovery.

This is for ethical, legal use only. Do not attempt to access others’ accounts or data without permission.

Background

Back in 2015, I had a Galaxy Tab 3 SM-T110 that stored a lot of my memories: photos, videos, and apps like WhatsApp and Instagram. Over time, it broke down, the battery gave out, and it just wouldn’t turn on anymore.

I managed to bring it back to life and recovered my media files. WhatsApp, however, no longer worked on Android 4.2.2, so I couldn’t open it. The good news was that the local WhatsApp data was still there, waiting to be recovered.

This tool helps you extract keys and local databases from WhatsApp for personal restoration and analysis.

What this does

  • Extract WhatsApp encryption keys stored locally on the device.
  • Retrieve local WhatsApp databases for analysis or personal backup.
  • Work on non-rooted Android devices without compromising device security.

Reproducible Environment

To reproduce the results exactly, install the following tools on your machine. The project does not include binaries due to licensing and security reasons.

Tool / File Version Notes
Java (JDK/JRE) 17.0.11 LTS Required to run abe.jar. Confirm with java -version.
Android Debug Bridge (ADB) 1.0.32 Needed to communicate with the Android device. Confirm with adb version.
GNU tar 1.12 Used to extract .tar files generated by ABE.
ABE abe-e252b0b.jar Converts .ab backups to .tar.
Legacy WhatsApp APK 2.11.431 Used to install on the device for backup purposes.
Data Directory data/ folder in project root to save extracted keys and databases (auto-created).
Logs Directory logs/ folder in project root to save run logs (auto-created).

How to Run

Follow these steps to extract WhatsApp keys and databases safely:

1. Prepare Your Environment

  • Ensure all required tools are downloaded and available:
    • Java JDK (17.0.11 LTS)
    • Android Debug Bridge (ADB) (1.0.32)
    • GNU tar (1.12)
    • ABE jar (e252b0b)
    • Legacy WhatsApp APK (2.11.431)
  • Place these tools in a folder (for example, requirements/) and update whatsapp_config.py with the correct paths.
  • Make sure Python is installed and accessible from your terminal.

2. Enable USB Debugging on Your Android Device

  • Go to Settings → Developer Options.
  • On Android 4.2+ (API 17+), Developer Options is hidden by default:
    1. Go to Settings → About phone/tablet.
    2. Tap Build number 7 times until you see “You are now a developer.”
    3. Return to Settings → Developer Options.
  • Enable USB Debugging.
  • Keep the device unlocked throughout the process.

3. Connect Your Device

  • Use a USB cable to connect the device to your computer.
  • Verify the connection:
    adb devices
    • The device should show up as device.
    • If prompted, allow USB debugging access.

4. Run the WhatsApp Script

  • Open a terminal/command prompt in the project directory.
  • Run:
    python whatsapp.py
  • Most commands will run automatically on the device. Only interact with the device when prompted.

5. Confirm the Backup

  • When the script prompts, confirm the backup operation on your device.
  • Do not disconnect or close the terminal during this step.

6. Check Results

  • Once complete:
    • Extracted encryption keys and databases are in data/.
    • Detailed logs are in logs/.
  • You can now safely analyze your WhatsApp backup or use it for personal restoration purposes.

Notes & Troubleshooting

  • Keep your device unlocked and connected until the script finishes.
  • Only run on devices and data you personally own.
  • If the script fails:
    • Check adb devices to ensure the device is listed.
    • Confirm the paths in whatsapp_config.py are correct.
    • Make sure USB debugging is enabled and the device is unlocked.
    • Confirm Java version with java -version.

Contributions

Contributions are welcome! Suggest improvements, add instructions, or provide tips for other devices/WhatsApp versions. Please fork the repository and submit a pull request.

Legal & Privacy Disclaimer

Important: Use responsibly. By using this tool, you agree to:

  • Ownership Requirement: Only use on devices and data you personally own.
  • No Liability: The creator or maintainer is not responsible for misuse, data loss, or legal consequences.
  • Encryption Awareness: WhatsApp messages are encrypted. This tool is solely for personal backup and recovery.

License

Released under the GNU General Public License v3.0. Use, modify, and distribute according to GPL 3 terms.`;

About

Extract WhatsApp encryption keys and local message databases from non-rooted Android devices for backup analysis and message recovery.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages