federicodotta / Brida

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

How should I spawn an app in Android Emulator #37

Closed illnino closed 3 years ago

illnino commented 5 years ago

Description

I am using GenyMotion. It has no problem by running.

frida -U 1234

However, Brida failed to launch the app.

Setting

frida local

Error Log


**** Console cleared successfully ****  Pyro server started correctly  Exception with spawn application net.razorvine.pyro.PyroException: [frida.TransportError] the connection is closed net.razorvine.pyro.serializer.PyroExceptionSerpent.FromSerpentDict(PyroExceptionSerpent.java:32) net.razorvine.pyro.serializer.SerpentSerializer$DictConverter.convert(SerpentSerializer.java:58) net.razorvine.serpent.ObjectifyVisitor.visit(ObjectifyVisitor.java:69) net.razorvine.serpent.ast.DictNode.accept(DictNode.java:8) net.razorvine.serpent.ast.Ast.accept(Ast.java:51) net.razorvine.serpent.ast.Ast.getData(Ast.java:45) net.razorvine.pyro.serializer.SerpentSerializer.deserializeData(SerpentSerializer.java:47) net.razorvine.pyro.PyroProxy.internal_call(PyroProxy.java:272) net.razorvine.pyro.PyroProxy.call(PyroProxy.java:178) burp.BurpExtender.actionPerformed(BurpExtender.java:1224) java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) java.desktop/java.awt.Component.processMouseEvent(Component.java:6632) java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) java.desktop/java.awt.Component.processEvent(Component.java:6397) java.desktop/java.awt.Container.processEvent(Container.java:2263) java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008) java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) java.desktop/java.awt.Component.dispatchEvent(Component.java:4840) java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772) java.desktop/java.awt.Component.dispatchEvent(Component.java:4840) java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) java.base/java.security.AccessController.doPrivileged(Native Method) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) java.base/java.security.AccessController.doPrivileged(Native Method) java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)  Pyro server shutted down  
federicodotta commented 4 years ago

Hi!

I never tried Brida with emulator (I usually use real devices).

Currently I'm very busy but I will try with an emulator and I will let you know.

Federico

nyxman-dev commented 4 years ago

Hi @illnino and @federicodotta

I have another issue with GenyMotion

**** Console cleared successfully **** Pyro server started correctly frida-compile completed successfully Exception with spawn application net.razorvine.pyro.PyroException: [frida.ExecutableNotFoundError] unable to find executable at 'md.XXXX.XXXXX' net.razorvine.pyro.serializer.PyroExceptionSerpent.FromSerpentDict(PyroExceptionSerpent.java:32) net.razorvine.pyro.serializer.SerpentSerializer$DictConverter.convert(SerpentSerializer.java:58) net.razorvine.serpent.ObjectifyVisitor.visit(ObjectifyVisitor.java:69) net.razorvine.serpent.ast.DictNode.accept(DictNode.java:8) net.razorvine.serpent.ast.Ast.accept(Ast.java:51) net.razorvine.serpent.ast.Ast.getData(Ast.java:45) net.razorvine.pyro.serializer.SerpentSerializer.deserializeData(SerpentSerializer.java:47) net.razorvine.pyro.PyroProxy.internal_call(PyroProxy.java:272) net.razorvine.pyro.PyroProxy.call(PyroProxy.java:178) burp.BurpExtender$17.run(BurpExtender.java:2713) 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:832)

BRIDA_Exception

Any idea how to fix this exception please?

Thanks!

federicodotta commented 4 years ago

HI @nyxman-dev,

I have not tried yet Brida with an emulator, but I'm quite sure that "Frida local" is wrong in you environment. Frida local is for local processes on your Windows/Mac/Linux operating system. You have to choose "Frida USB" if you usually run Frida with "frida -U" or remote if you usually use "frida -R".

Federico

nyxman-dev commented 4 years ago

@federicodotta I can run frida without any issue from CLI, frida -U -f md.testapp.dev -l "D:\SOC.MD\TOOLS\GENIMOTION 3\platform-tools_r30.0.1-windows\platform-tools\fridascript.js" image I just think it's not intended to work with genymotion emulator, because if I set it to Frida USB as you mentioned, the problem persist.

image

federicodotta commented 4 years ago

Hi @nyxman-dev

There is a strange bug with Android (maybe in Frida python lib or maybe in Brida, at the moment I don't understand where it is) and the first time that you try to spawn after you start the server it gives the error "device not found". Please try to click again on "spawn" and let me know.

Federico

lcage commented 4 years ago

hi @federicodotta am facing the trouble as well. Am trying to access an Android emulator. I'm on a windows machine as well.

image

Using frida am able to access the android app on the android emulator as shown below. Any suggestions would be helpful

image

amitaknkpt commented 4 years ago

{ SOLUTION } I was facing the same problem.

Here is the fix :

After setting up everything:

Step 1:

open new terminal

run this command:

adb forward tcp:27042 tcp:27042

Untitled Step 2:

--> After that goto Brida configuration tab and change pyro port with 27042

--> Select Frida Remote

Untidtled

federicodotta commented 3 years ago

Hi,

I close the issue because it is very old and because a solution has been supplied. If the solution of @amitaknkpt did not work please reopen a new issue.

Thank you, Federico