|
| 1 | +diff --git a/console/cli.py b/console/cli.py |
| 2 | +index 1fc22fb..80e52dc 100644 |
| 3 | +--- a/console/cli.py |
| 4 | ++++ b/console/cli.py |
| 5 | +@@ -31,8 +31,10 @@ from ..utils.helpers import normalize_gadget_name, print_frida_connection_help, |
| 6 | + @click.option('--serial', '-S', required=False, default=None, help='A device serial to connect to.') |
| 7 | + @click.option('--debug', '-d', required=False, default=False, is_flag=True, |
| 8 | + help='Enable debug mode with verbose output. (Includes agent source map in stack traces)') |
| 9 | ++@click.option('--certificate', '-c', required=False, default=None, help="Frida connection certificate") |
| 10 | ++@click.option('--token', '-t', required=False, default=None, help="Frida connection token") |
| 11 | + def cli(network: bool, host: str, port: int, api_host: str, api_port: int, |
| 12 | +- gadget: str, serial: str, debug: bool) -> None: |
| 13 | ++ gadget: str, serial: str, debug: bool, certificate: str, token: str) -> None: |
| 14 | + """ |
| 15 | + \b |
| 16 | + _ _ _ _ |
| 17 | +@@ -56,6 +58,8 @@ def cli(network: bool, host: str, port: int, api_host: str, api_port: int, |
| 18 | + state_connection.use_network() |
| 19 | + state_connection.host = host |
| 20 | + state_connection.port = port |
| 21 | ++ state_connection.certificate = certificate |
| 22 | ++ state_connection.token = token |
| 23 | + |
| 24 | + if serial: |
| 25 | + state_connection.device_serial = serial |
| 26 | +diff --git a/utils/agent.py b/utils/agent.py |
| 27 | +index 6d88e3a..fbe9b40 100644 |
| 28 | +--- a/utils/agent.py |
| 29 | ++++ b/utils/agent.py |
| 30 | +@@ -126,8 +126,13 @@ class Agent(object): |
| 31 | + return device |
| 32 | + |
| 33 | + if state_connection.get_comms_type() == state_connection.TYPE_REMOTE: |
| 34 | ++ kwargs = {} |
| 35 | ++ if state_connection.certificate: |
| 36 | ++ kwargs["certificate"] = state_connection.certificate |
| 37 | ++ if state_connection.token: |
| 38 | ++ kwargs["token"] = state_connection.token |
| 39 | + device = frida.get_device_manager().add_remote_device('{host}:{port}'.format( |
| 40 | +- host=state_connection.host, port=state_connection.port)) |
| 41 | ++ host=state_connection.host, port=state_connection.port), **kwargs) |
| 42 | + click.secho('Using networked device @`{n}`'.format(n=device.name), bold=True) |
| 43 | + |
| 44 | + return device |
0 commit comments