Created
January 2, 2021 00:54
-
-
Save ndrong/2dea662016704fb99edcf0e9c7961e5f to your computer and use it in GitHub Desktop.
Frida snippet used to hook hashing methods
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
Java.perform(function() { | |
const target = Java.use('nl.avro.demol.base.extensions.StringKt'); | |
target.calculateHmac.implementation = function() { | |
const args = JSON.stringify(arguments, null, 2); | |
const retVal = target.calculateHmac.apply(this, arguments); | |
console.log('[!] calculateHmac called!'); | |
console.log('Arguments:', args); | |
return retVal; | |
} | |
target.hmac.implementation = function() { | |
const args = JSON.stringify(arguments, null, 2); | |
const retVal = target.hmac.apply(this, arguments); | |
console.log('[!] hmac called!'); | |
console.log('Arguments:', args); | |
var buffer = Java.array('byte', retVal); | |
var result = ""; | |
for (var i = 0; i < buffer.length; ++i) { | |
result+= (String.fromCharCode(buffer[i])); | |
} | |
console.log('Return value: ', result); | |
return retVal; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment