sensepost / objection

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

[bug?] Am I a noob or what ? #480

Closed maximebories closed 2 years ago

maximebories commented 3 years ago

Describe the bug I have been successfully using Frida for a few month, but I never had had the chance to have Objection working. Up until recently it was because of a supposed openssl version not supported by libmobileidevice. That was on a MacBook Pro. Right now on Mac mini this is what I'm experiencing:

Screenshot 2021-09-06 at 17 47 52

To Reproduce Steps to reproduce the behavior:

  1. pip install frida-tools
  2. pip install objection
  3. objection --debug --gadget frida-server explore

Similar issues Only one I found with same exact error output

Environment

leonjza commented 3 years ago

Please run it again with the --debug flag and paste the output?

maximebories commented 3 years ago

Thank you for your response. I did tried that and there was no difference at all, sorry for not mentioning it. It's not surprising thought, Objection doesn't pass the debug flag and Frida is the first call in the error stack. I will try to force the debug option on the Frida side.

leonjza commented 3 years ago

The debug flag should enable the source map so that we can see where in the agent the crash occurred. Please paste the crash with the flag enabled.

maximebories commented 3 years ago

Exact, I need to put more contrast. Here you go:

Screenshot 2021-09-07 at 21 19 11

leonjza commented 3 years ago

No it's not the same. It now tells us line 8 in environment.ts is to blame, but sadly it seems like the sourcemap is wrong.

novitae commented 2 years ago

@leonjza Any update on this ? I am getting the same issue

ae@MBP-de-t frida % objection --debug --gadget IMRemoteURLConnectionAgent explore
[debug] Agent path is: /usr/local/lib/python3.9/site-packages/objection/agent.js
[debug] Injecting agent...
Using USB device `iPhone`
[debug] Attempting to attach to process: `IMRemoteURLConnectionAgent`
[debug] Process attached!
Agent injected and responds ok!
Traceback (most recent call last):
  File "/usr/local/bin/objection", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/objection/console/cli.py", line 156, in explore
    device_info = get_device_info()
  File "/usr/local/lib/python3.9/site-packages/objection/commands/device.py", line 27, in get_device_info
    package_info = api.env_ios()
  File "/usr/local/lib/python3.9/site-packages/frida/core.py", line 468, in method
    return script._rpc_request('call', js_name, args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/frida/core.py", line 400, in _rpc_request
    raise result[2]
frida.core.RPCException: TypeError: cannot read property 'currentDevice' of undefined
    at <anonymous> (src/generic/environment.ts:55)
    at envIos (src/rpc/environment.ts:8)
    at apply (native)
    at <anonymous> (frida/runtime/message-dispatcher.js:13)
    at c (frida/runtime/message-dispatcher.js:23)
Asking jobs to stop...
Unloading objection agent...
[debug] Calling unload()

env

my Frida is completely fine, it is the first time I am using objection (and the process I am targeting is running while using the script, same error targeting via pid)

leonjza commented 2 years ago

Sorry for the late reply here!

I just realised that ya'll targeting processes that are not mobile processes. Objection only supports mobile apps at this point in time. If someone is keen, the reason it fails is because these calls on UIDevice won't work on all processes. We could probably rip out the device specific calls and make objection work on any process.

novitae commented 2 years ago

I just realised that ya'll targeting processes that are not mobile processes. Objection only supports mobile apps at this point in time. If someone is keen, the reason it fails is because these calls on UIDevice won't work on all processes. We could probably rip out the device specific calls and make objection work on any process.

You should rename the issue with the exception we get, so people having the same issue are seing that.

RobLinux commented 1 year ago

Any update with this ?