federicodotta / Brida

The new bridge between Burp Suite and Frida!
MIT License
1.61k stars 206 forks source link

Error receiving message from Frida exported function in Pyro proxy #94

Open mr-r3bot opened 2 years ago

mr-r3bot commented 2 years ago

Hi Brida Team ( cc: @federicodotta ), I'm running to an issue when trying to get the result from calling exported Frida function. Brida exported function is working fine and return a string value, but something went wrong with the Pyro proxy so I cannot get the result from that ( I"m calling exported function from Custom Burp Plugin )

The code and stack traces are below: Java code calling Frida exported function:

String pyroUrl = "PYRO:BridaServicePyro@localhost:9999";
                try {
                    PyroProxy pp = new PyroProxy(new PyroURI(pyroUrl));
                    String ret = (String)pp.call("callexportfunction","encryptdecryptaes");
                    stdout.println("Result from Frida JS: " + ret);
                    pp.close();
                } catch (Exception e) {
                    // EXCEPTION HANDLING
                    stderr.println("Error from PyroProxy: " + e.getMessage());
                    StackTraceElement[] exceptionElements = e.getStackTrace();
                    for (int i=0; i< exceptionElements.length; i++) {
                        stderr.println(exceptionElements[i].toString());
                    }

Error from Burp plugin extension:

Error from PyroProxy: invalid protocol version: 48
net.razorvine.pyro.Message.from_header(Message.java:212)
net.razorvine.pyro.Message.recv(Message.java:269)
net.razorvine.pyro.PyroProxy._handshake(PyroProxy.java:361)
net.razorvine.pyro.PyroProxy.connect(PyroProxy.java:70)
net.razorvine.pyro.PyroProxy.internal_call(PyroProxy.java:223)
net.razorvine.pyro.PyroProxy.call(PyroProxy.java:180)
burp.BurpExtender.processHttpMessage(BurpExtender.java:64)
burp.ec1.run(Unknown Source)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
java.base/java.lang.Thread.run(Thread.java:831)
federicodotta commented 2 years ago

Hi @mr-r3bot

Uhmm... very strange issue. I never obtained that exception. I will try to understand the reasons in the the days and I will let you know!

Federico