Skip to content

Instantly share code, notes, and snippets.

@fs0c131y
Created January 27, 2019 20:57
Show Gist options
  • Save fs0c131y/a3dbf8db1f1ed79ea5dbc178463c430c to your computer and use it in GitHub Desktop.
Save fs0c131y/a3dbf8db1f1ed79ea5dbc178463c430c 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