Created
January 27, 2019 20:57
-
-
Save fs0c131y/a3dbf8db1f1ed79ea5dbc178463c430c to your computer and use it in GitHub Desktop.
Frida script to get the password of a sqlcipher database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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