sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.33k stars 840 forks source link

[bug] Unable to attach to process #479

Closed jj0e closed 3 years ago

jj0e commented 3 years ago

Description

I'm patching a newly updated APK file via the patchapk command. The patch is successful, however when I open the app on my physical device, and type objection -d -g com.joe.app explore, it says

Attempting to attach to process : `com.joe.app`

and hangs forever. For some reason, it is unable to connect to the Frida server.

To Reproduce Steps to reproduce the behavior:

  1. Download this apk
  2. Run command objection patchapk appName.apk
  3. Open the app
  4. Run objection gadget

Similar issues

476, #469, #472

Expected behavior The app should be able to load. Using older patched APK files with older version of Frida are working fine.

Environment (please complete the following information):

Additional context

This is 100% a bug with the patchapk process. A little while back, maybe a couple months ago, I patched this app on version 3.6.1 using the patchapk command. I still have this patched version and am able to run it smoothly. However, today when I try to patch the exact same version of the app, I run into this bug when trying to run it. I'm not familiar at all with Frida or objection internals, but it seems like it has something to do with the version it uses during the patching process:

Using latest Github gadget version: 15.0.14
Patcher will be using Gadget version: 15.0.14

Based on what I'm reading it seems like there were quite a few changes with Frida 15+ that may be causing it? Is there a way for us to use a downgraded version in the meantime?

leonjza commented 3 years ago

Try using the PID of the launched app as the -g flag.

jj0e commented 3 years ago

Try using the PID of the launched app as the -g flag.

There is an issue as well when trying to get the PID via frida-ps -U. If the app is opened, this command hangs as well. As soon as I close the app, the PID's are returned but the app is closed so it doesn't show obviously.

leonjza commented 3 years ago

Also, update your local frida packages to the latest. pip3 install -U frida frida-tools.

jj0e commented 3 years ago

Also, update your local frida packages to the latest. pip3 install -U frida frida-tools.

This worked, thank you so much!

adfnekc commented 11 months ago

works for me,thank you