sensepost / objection

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

Script gets destroyed after entering anything on hooking an app. #533

Closed its0dayy closed 2 months ago

its0dayy commented 2 years ago

After opening the app with: objection --gadget com.app explore

Whatever i write after that ex: env, android hooking list classes etc, i get this error:

An unexpected internal exception has occurred. If this looks like a code related error, please file a bug report! script has been destroyed

Python stack trace: Traceback (most recent call last):
  File "/home/kali/.local/lib/python3.9/site-packages/objection/console/repl.py", line 371, in start_repl
    self.run_command(document)
  File "/home/kali/.local/lib/python3.9/site-packages/objection/console/repl.py", line 185, in run_command
    exec_method(arguments)
  File "/home/kali/.local/lib/python3.9/site-packages/objection/commands/device.py", line 68, in get_environment
    _get_android_environment()
  File "/home/kali/.local/lib/python3.9/site-packages/objection/commands/device.py", line 95, in _get_android_environment
    paths = state_connection.get_api().env_android_paths()
  File "/home/kali/.local/lib/python3.9/site-packages/frida/core.py", line 468, in method
    return script._rpc_request('call', js_name, args, **kwargs)
  File "/home/kali/.local/lib/python3.9/site-packages/frida/core.py", line 26, in wrapper
    return f(*args, **kwargs)
  File "/home/kali/.local/lib/python3.9/site-packages/frida/core.py", line 400, in _rpc_request
    raise result[2]
frida.InvalidOperationError: script has been destroyed
CDuPlooy commented 2 years ago

Try enabling debug output

d3ibis commented 2 years ago

I'm facing this issue too, it works fine with some apps BUT apps I need to work with is not working... Here is a video record:

https://user-images.githubusercontent.com/17270352/167223601-3570bd5f-1b32-42df-8706-004b0a0ab87e.mov

And this is what I get:

An unexpected internal exception has occurred. If this looks like a code related error, please file a bug report! script has been destroyed

Python stack trace: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objection/console/repl.py", line 371, in start_repl self.run_command(document) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objection/console/repl.py", line 185, in run_command exec_method(arguments) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objection/commands/device.py", line 65, in get_environment _get_ios_environment() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/objection/commands/device.py", line 82, in _get_ios_environment paths = state_connection.get_api().env_ios_paths() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/frida/core.py", line 468, in method return script._rpc_request('call', js_name, args, *kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/frida/core.py", line 26, in wrapper return f(args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/frida/core.py", line 400, in _rpc_request raise result[2] frida.InvalidOperationError: script has been destroyed

Screen Shot 2022-05-07 at 1 24 59 AM

leonjza commented 2 years ago

Could you try some vanilla Frida instrumentation using a simple script to test if that works? The other option is to provide some device log output to see if that reveals anything.

g2asell2019 commented 2 years ago

probably app has anti-frida or anti-hook

IPMegladon commented 2 months ago

Closing issue as stale, feel free to reopen.