Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eugenpirogoff/55a844d8fa7927a503a8b514775bfe0a to your computer and use it in GitHub Desktop.
Save eugenpirogoff/55a844d8fa7927a503a8b514775bfe0a to your computer and use it in GitHub Desktop.
Frida script to get the password of a sqlcipher database
/*
* get_sqlcipher_password.js
* Copyright (c) 2019 Elliot Alderson <fs0c131y@protonmail.com>
*
* Frida.re JS functions to get SQLCipher database passwords.
*
* Example usage:
* # frida -U -f in.gov.uidai.mAadhaarPlus -l get_sqlcipher_password.js --no-pause
*
*/
'use strict;'
function getSQLCipherPassword() {
var SQLiteOpenHelper = Java.use('net.sqlcipher.database.SQLiteOpenHelper');
SQLiteOpenHelper.getWritableDatabase.overload('java.lang.String').implementation = function (password) {
console.log("[+] password = " + password);
return this.getWritableDatabase.overload('java.lang.String').apply(this, arguments);
}
}
Java.perform(function () {
getSQLCipherPassword();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment