Closed aph3rson closed 5 years ago
I will need some help with this issue. Just to confirm, connecting to the process name (as shown with frida-ps) after spawning with the bundle identifier works ok?
I just tried this, and it was able to connect by using the process name - however, the application was killed shortly-thereafter (about a 30 second delay after launching).
I did some more debugging as well - doing frida -f "com.company.app"
spawns it just the same, and %resume
works as expected - the app is spawned, and the process continues. Interestingly enough, though, when connecting to the process spawned by Objection, doing %resume
and %reload
gives me a bad food error from Springboard (the process is taking too long to launch).
I was actually able to fix this myself - part of the issue is here: https://github.com/sensepost/objection/blob/ce36dd1541491bc6ec048b73a2ae91a406847e13/objection/utils/agent.py#L157-L162
We have the PID already, we should be using this to connect to the process. This fixes any issues where the gadget name might not be the same as the process name (e.g. with spawned processes on iOS).
I'll file a PR to fix this.
Describe the bug Frida-server supports launching iOS apps by passing the bundle identifier (CFBundleIdentifier from Info.plist). The app launches just fine, but Objection doesn't appear to be able to connect after the app is launched
To Reproduce Steps to reproduce the behavior:
objection --gadget "com.company.app" explore
Expected behavior App is launched, and objection is connected to the frida-server instance.
Evidence / Logs / Screenshots The following behavior is noted:
A newer version of objection is available! You have v1.5.2 and v1.6.2 is ready for download.
Upgrade with: pip3 install objection --upgrade For more information, please see: https://github.com/sensepost/objection/wiki/Updating
Using networked device @
load_entry_point('objection==1.5.2', 'console_scripts', 'objection')()
File "c:\python37\lib\site-packages\click\core.py", line 764, in call
return self.main(args, kwargs)
File "c:\python37\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\python37\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\python37\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, ctx.params)
File "c:\python37\lib\site-packages\click\core.py", line 555, in invoke
return callback(args, **kwargs)
File "c:\python37\lib\site-packages\objection\console\cli.py", line 109, in explore
agent.inject()
File "c:\python37\lib\site-packages\objection\utils\agent.py", line 195, in inject
session = self._get_session()
File "c:\python37\lib\site-packages\objection\utils\agent.py", line 163, in _get_session
return self.device.attach(state_connection.gadget_name)
File "c:\python37\lib\site-packages\frida\core.py", line 110, in attach
return Session(self._impl.attach(self._pid_of(target)))
File "c:\python37\lib\site-packages\frida\core.py", line 128, in _pid_of
return self.get_process(target).pid
File "c:\python37\lib\site-packages\frida\core.py", line 75, in get_process
raise _frida.ProcessNotFoundError("unable to find process with name '%s'" % process_name)
frida.ProcessNotFoundError: unable to find process with name 'com.company.app'
10.20.30.40:27042
Traceback (most recent call last): File "C:\Python37\Scripts\objection-script.py", line 11, inEnvironment (please complete the following information):
Additional context Running over a network connection. Host is a Windows device.