Comments (7)
Hi!
Your hooks are inspection hooks but are not correct for Brida.
You can use your hooks with Frida or Brida in order to print arguments and return value of a method when the inspected method is called from the application.
If you want to call a method directly with Brida (with Execute Method or Context Menu or Custom Extension) you have to define a JS function in the Export section of Brida JS file. In your function you don't have to overload the method. You can simply take a reference to target class and then directly call target method.
For example, if your encryption method b is a static method:
rpc.exports = {
encryptrequest: function(param1,param2,param3) {
Java.perform(function() {
var myclass = Java.use("com.package.company.a");
return myclass.b(param1,param2,param3);
});
}
}
Let me know if this works in your situation.
Federico
from brida.
Hi, Federicodotta
I have updated my scriptBrida.js as suggested.
rpc.exports = {
encryptrequest: function(param1,param2,param3) {
Java.perform(function() {
var myclass = Java.use("com.package.company.a");
return myclass.b(param1,param2,param3);
});
}
}
Then I inspected method - com.package.company.a.b
.
When I executed the method - encryptrequest, I got below on the console. The output was still null, though the inspected method had suggested the method has been called.
*** entered com.package.company.a.b
Parameters:
arg[0]: plaintext
arg[1]: mykey
arg[2]: myiv
*** exiting com.package.company.a.b
Return value:
retval: cipher_text
*** Output encryptrequest:
null
Any idea? Did I miss anything? Thanks.
from brida.
Uhm... Method "com.package.company.a.b" is a static method or an instance one?
Because if "b" method is an instance method, maybe you have to obtain a reference to an instance of that object or call the constructor of that class in order to be able to call "b", for example in this way:
var myclass = Java.use("com.package.company.a");
var myinstance = myclass.$new();
myinstance .b(param1,param2,param3);
Keep in mind that obtaining an instance of objects created by target application during runtime is not always an easy task...
Federico
from brida.
From the decompiled code, I could see
public static String b(String str, String str2, String str3) {
// encryption alg goes here
}
from brida.
Very strange. Your configuration seems correct, the method is a static method and arguments and return value are strings.
I check again for a bug in that functionality of Brida but I haven't find on.
Can you try the execute method with another function of the same binary?
from brida.
Hi ilnino,
I just checked again the "Execute method" with the last version of Frida on Android and iOS and it works.
I write you a couple of things:
- On the BAppStore there was a wrong (old) version of Brida. Now there is the correct (new) version of Brida. Try to delete Brida and re-download it from BAppStore
- If you edit the JavaScript file after launching the application with Brida, you have to reload the JS file using "Reload JS" button on Brida
Let me know if you can solve the problem.
Federico
from brida.
I close the issue. If you need more help let me knwo and I will reopen the issue.
from brida.
Related Issues (20)
- error: unknown option '-x' HOT 6
- Exception with attach application HOT 5
- frida-compile: error: unrecognized arguments: -x
- Spawn Application function is not available HOT 5
- Custom plugin not shows encrypted or decrypted result HOT 4
- Exception with execute method HOT 9
- Exception with getting info Android/iOS HOT 6
- It will cause burpsuite to get stuck. HOT 2
- Entrypoint must be inside the project root (ERROR)
- there is an error when crypt response HOT 1
- Stop server did not work with last Java versions HOT 1
- If I enable the hook crypto stuff option, burp suite crashes. HOT 3
- Parameter cannot be passed HOT 1
- Cant use inspect or inspect with backtrace HOT 1
- Kill server button not working HOT 1
- How to install Brida Frida etc
- Error during frida-compile, potentially caused by compilation errors. Aborting. HOT 1
- Failed Get Result Custom Plugin HOT 5
- 求助!brida0.6无法hook
- Got error for graphical hook[Exception running starting tree hook Tree hook trace java_class] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brida.