sensepost / objection

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

[bug] frida.InvalidOperationError: script has been destroyed #684

Closed vladavoX closed 2 months ago

vladavoX commented 3 months ago

Describe the bug Tried on other apps, that are found by frida-ps -Uai, only this one fails

D:\Program Files\Nox\bin>frida-ps -Uai
 PID  Name               Identifier
----  -----------------  -----------------------------
2420  Facebook           com.facebook.katana
3306  Google Play Store  com.android.vending
   -  Amaze              com.amaze.filemanager
   -  App Center         com.android.Calendar
   -  Browser            com.android.browser
   -  Camera             com.android.camera2
   -  Files              com.android.documentsui
   -  Gallery            com.android.gallery3d
   -  Google Play Games  com.google.android.play.games
   -  GoogleSign         com.pekall.fmradio
   -  Rumble             com.blizzard.arc
   -  Settings           com.android.settings
   -  Tutorials          com.android.calculator2

D:\Program Files\Nox\bin>objection --gadget com.blizzard.arc explore
Using USB device `SM-G965N`
Agent injected and responds ok!
Traceback (most recent call last):
  File "\\?\C:\Users\voX\AppData\Local\Programs\Python\Python37-32\Scripts\objection-script.py", line 33, in <module>
    sys.exit(load_entry_point('objection==1.11.0', 'console_scripts', 'objection')())
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\objection\console\cli.py", line 156, in explore
    device_info = get_device_info()
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\objection\commands\device.py", line 41, in get_device_info
    package_info = api.env_android()
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\frida\core.py", line 180, in method
    return script._rpc_request(request, data, **kwargs)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\frida\core.py", line 86, in wrapper
    return f(*args, **kwargs)
  File "c:\users\vox\appdata\local\programs\python\python37-32\lib\site-packages\frida\core.py", line 497, in _rpc_request
    raise result.error
frida.InvalidOperationError: script has been destroyed
Asking jobs to stop...
Unloading objection agent...
Unable to run cleanups: script is destroyed

To Reproduce Steps to reproduce the behavior:

  1. Run command 'objection --gadget com.blizzard.arc explore'

Expected behavior To enter explore

Evidence / Logs / Screenshots Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:

objection --debug explore

Environment (please complete the following information):

Application If possible, please attach the target application where you can reproduce this bug to the issue.

Additional context Add any other context about the problem here.

IPMegladon commented 2 months ago

The application may have Frida or debugging detection or similar. Would recommend trying to just connect to it using vanilla Frida first.

IPMegladon commented 2 months ago

Closing as stale for now. Feel free to reopen if you could determine that the issue is related to objection and not due to app protections.