Cant connect to different port

Open
#185 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start in objection/utils/frida_transport.py, especially get_session(), and trace how the -p 50005 option reaches the Frida connection setup; the traceback also identifies objection/console/cli.py as the entry point. Reproduce with the supplied frida-server and objection commands, then verify that the requested non-standard port works over USB without the ServerNotRunningError.

Written by the indexing model from the issue text.

Description

🐛bug

Objection fails to connect to frida-server on the non standard port when connected via USB.

Started frida-server with:
./frida-server-12.3.1-android-arm -l 0.0.0.0:50005

Started objection with:
objection -p 50005 -g [REDACTED] explore

Stack trace from objection:

Traceback (most recent call last):
  File "/usr/bin/objection", line 11, in <module>
    load_entry_point('objection==1.4.3', 'console_scripts', 'objection')()
  File "/usr/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/objection/console/cli.py", line 78, in explore
    r.run_command(command)
  File "/usr/lib/python3.7/site-packages/objection/console/repl.py", line 200, in run_command
    exec_method(arguments)
  File "/usr/lib/python3.7/site-packages/objection/commands/android/hooking.py", line 280, in set_method_return_value
    runner.run_as_job(name='set-return-value', args=args)
  File "/usr/lib/python3.7/site-packages/objection/utils/frida_transport.py", line 380, in run_as_job
    job.session = self.get_session()
  File "/usr/lib/python3.7/site-packages/objection/utils/frida_transport.py", line 285, in get_session
    return device.attach(state_connection.gadget_name)
  File "/usr/lib/python3.7/site-packages/frida/core.py", line 110, in attach
    return Session(self._impl.attach(self._pid_of(target)))
  File "/usr/lib/python3.7/site-packages/frida/core.py", line 128, in _pid_of
    return self.get_process(target).pid
  File "/usr/lib/python3.7/site-packages/frida/core.py", line 69, in get_process
    matching = [process for process in self._impl.enumerate_processes() if fnmatch.fnmatchcase(process.name.lower(), process_name_lc)]
frida.ServerNotRunningError: unable to connect to remote frida-server: closed
Dominant language
Python
Stars
9.4k
Forks
1k
Avg merge
14d 5h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sensepost/objection

All issues in sensepost/objection

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.