sensepost / objection

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

[Question] Dev Installation Problem #668

Closed capt-meelo closed 7 months ago

capt-meelo commented 7 months ago

I'm trying to play around with objection and potentially contribute. I tried the dev installation guide posted in the wiki but I noticed that the objection that gets installed by following the guide is different. For example, right after the installation and running objection, I'm getting the following error:

$ objection
Traceback (most recent call last):
  File "/home/meelo/tools/objection/venv/bin/objection", line 5, in <module>
    from objection.console.cli import cli
  File "/home/meelo/tools/objection/objection/console/cli.py", line 7, in <module>
    from objection.commands.plugin_manager import load_plugin
  File "/home/meelo/tools/objection/objection/commands/plugin_manager.py", line 8, in <module>
    from ..utils.plugin import Plugin as PluginType
  File "/home/meelo/tools/objection/objection/utils/__init__.py", line 7, in <module>
    from .update_checker import check_version
  File "/home/meelo/tools/objection/objection/utils/update_checker.py", line 7, in <module>
    from pkg_resources import parse_version
ModuleNotFoundError: No module named 'pkg_resources'

A similar issue was reported before and the provided solution (pip install --force-reinstall -U setuptools) worked. However, the objection that gets installed is not fully functional. One good example is that the explore command is missing.

$ objection
Usage: objection [OPTIONS] COMMAND [ARGS]...

       _   _         _   _
   ___| |_|_|___ ___| |_|_|___ ___
  | . | . | | -_|  _|  _| | . |   |
  |___|___| |___|___|_| |_|___|_|_|
        |___|(object)inject(ion)

       Runtime Mobile Exploration
          by: @leonjza from @sensepost

Options:
  -N, --network            Connect using a network connection instead of USB.
  -h, --host TEXT          [default: 127.0.0.1]
  -p, --port INTEGER       [default: 27042]
  -ah, --api-host TEXT     [default: 127.0.0.1]
  -ap, --api-port INTEGER  [default: 8888]
  -n, --name TEXT          Name or bundle identifier to attach to.
  -S, --serial TEXT        A device serial to connect to.
  -d, --debug              Enable debug mode with verbose output.
  -s, --spawn              Spawn the target.
  -p, --no-pause           Resume the target immediately.
  -f, --foremost           Use the current foremost application.
  --debugger               Enable the Chrome debug port.
  --uid TEXT               Specify the uid to run as (Android only).
  --help                   Show this message and exit.

Commands:
  api       Start the objection API server in headless mode.
  patchapk  Patch an APK with the frida-gadget.so.
  patchipa  Patch an IPA with the FridaGadget dylib.
  run       Run a single objection command.
  signapk   Zipalign and sign an APK with the objection key.
  start     Start a new session
  version   Prints the current version and exits.
$ objection -N explore
Usage: objection [OPTIONS] COMMAND [ARGS]...
Try 'objection --help' for help.

Error: No such command 'explore'.
leonjza commented 7 months ago

The main branch has moved on since the last pypi release. I experimented with a command line change that I haven't finished yet which is why explore seems missing. It is not, it's just start atm.

capt-meelo commented 7 months ago

Got it now. Will try to read the code so I can find the other options. Thanks!