Brida icon indicating copy to clipboard operation
Brida copied to clipboard

Custom plugin not shows encrypted or decrypted result

Open 24h7d opened this issue 1 year ago • 4 comments

I have a problem when using custom plugins. After analyzing the stack trace I found the function for encrypt and decrypt the request / response. but when I hook it and used it in the custom plugin (I follow from the latest youtube video for Brida). nothing error shows, and the Brida console log was executed but decrypted/encrypted result does not appear in the highlighted parameter I choose. this is my additional js script in the brida.js mydecrypt: function(message) { var ret = null; Java.perform(function(){ var yoshi = Java.use("com.app.name.utils.AES"); console.log("Plugin Decrypt"); ret = yoshi.doDecrypt(message); }); return ret; },

the console.log executed but not returning any value. I use brida 0.5 and frida-compile 9.5.2

24h7d avatar Jul 27 '23 08:07 24h7d

Hi @24h7d,

Can you please give me more information? How do you configured the custom plugin?

If you click on the "Debug" button of the plugin and then try it, what output do you receive?

Federico

federicodotta avatar Jul 27 '23 12:07 federicodotta

Here my detail custom plugin set up:

My Custom Plugin: Screen Shot 2023-07-29 at 12 40 21

My JS hook script Screen Shot 2023-07-29 at 12 35 36

After right-clicking request and using MyDecrypt iContext Menu: Screen Shot 2023-07-29 at 19 26 25

I can confirm that I choose the right Java class to hook

24h7d avatar Jul 29 '23 13:07 24h7d

Hi @federicodotta thanks for your quick reply

the application has 2 function:

  1. doDecrypt
  2. doEncrypt

and I use like in the comment before.

24h7d avatar Aug 01 '23 05:08 24h7d

Hi @24h7d,

Sorry for the delay in the response.

One question. The doDecrypt and doEncrypt functions are static functions? Because you call them directly from the class but if they are not static you have to create first an instance of the class (of get one with a Frida hook or with Java.choose) and then call the functions.

If you call the same functions directly with Frida CLI they work correctly?

Federico

federicodotta avatar Mar 23 '24 14:03 federicodotta