Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device enrollment stuck #30

Closed
cryptax opened this issue Dec 8, 2020 · 6 comments
Closed

Device enrollment stuck #30

cryptax opened this issue Dec 8, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@cryptax
Copy link
Contributor

cryptax commented Dec 8, 2020

I am trying to enroll an emulator. It starts and then gets stuck and does not complete.

The terminal shows an error complaining it can't find frida_tools. Was I meant to install Frida? I think not... (I do have Frida but in a separate virtual environment).

Reproduce:

  • Fresh install
  • Load dexcalibur
  • Launch an emulator
  • Go to Device Manager on Dexcalibur, try to enroll

Screenshots

dexcalibur

The terminal shows this error:

[INFO] [ADB] /home/axelle/dexcaliburWS/.dxc/bin/platform-tools/adb -s emulator-5554 shell getprop
Traceback (most recent call last):
  File "/home/axelle/.local/bin/frida", line 7, in <module>
    from frida_tools.repl import main
ModuleNotFoundError: No module named 'frida_tools'
Error: Command failed: frida --version
Traceback (most recent call last):
  File "/home/axelle/.local/bin/frida", line 7, in <module>
    from frida_tools.repl import main
ModuleNotFoundError: No module named 'frida_tools'

    at checkExecSyncError (child_process.js:635:11)
    at Object.execSync (child_process.js:671:15)
    at Function.getLocalFridaVersion (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/FridaHelper.js:144:22)
    at Function.installServer (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/FridaHelper.js:299:27)
    at DeviceManager.enroll (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/DeviceManager.js:570:37)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/WebServer.js:622:38 {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer >,
    <Buffer 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 46 69 6c 65 20 22 2f 68 6f 6d 65 2f 61 ... 134 more bytes>
  ],
  pid: 326915,
  stdout: <Buffer >,
  stderr: <Buffer 54 72 61 63 65 62 61 63 6b 20 28 6d 6f 73 74 20 72 65 63 65 6e 74 20 63 61 6c 6c 20 6c 61 73 74 29 3a 0a 20 20 46 69 6c 65 20 22 2f 68 6f 6d 65 2f 61 ... 134 more bytes>
}

Desktop:

  • OS: Linux Mint 20
  • Node JS version: 12.20.0
  • Dexcalibur version (see 'package.json' or output) : 0.7.3

Device information:

  • Device: Emulator
  • Android version: Android 8.0 x86
  • Not rooted
@cryptax cryptax added the bug Something isn't working label Dec 8, 2020
@cryptax
Copy link
Contributor Author

cryptax commented Dec 8, 2020

If I install frida, it works.
Except, later when I am trying to hook my APK I get this error (though I saw a log before that where frida-server was being downloaded and installed to the emulator). Not sure if this is a related bug or a different one.

[INFO] [WEBSERVER] Start hooking [app=tuna.obvious.trust, type=spawn-self]
[Error: Unable to connect to remote frida-server: closed]
error: Unable to connect to remote frida-server: closed

@FrenchYeti
Copy link
Owner

Hello,

sorry for this late reply.

First issue happens when host-side frida binaries (frida-ps, frida, ...) cannot executed by Dexcalibur (spawn). During enrollment, Dexcalibur push a compatible frida-server server binary into the device. In this case, Dexcalibur starts by executing "frida --version" on the host to gather the local Frida version, and to avoid issue with frida-server version.

Second issue occurs because frida-server is not started, cannot be started by dexcalibur, or cannot be reached. With Android emulator, if you successfully enrolled your device, you should be able to enumerate installed through "Select an application" menu. Most of users connect Android emulator over TCP.

@cryptax
Copy link
Contributor Author

cryptax commented Dec 10, 2020

  1. Ok -- is that a bug of Dexcalibur, a missing requirement, or am I normally meant to install Frida by hand on the host?

  2. I installed the suspicious app on the emulator, and enumerated it fine. When I ask to analyze it, I get the following error. FYI, yes, Android emulator is over TCP.

[INFO] [APK HELPER] APK extracted into : /home/axelle/dexcaliburWS/tuna.obvious.trust/apk
Error: [CONNECTOR] Unknown connector : undefined
    at ConnectorFactory.newConnector (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/ConnectorFactory.js:60:19)
    at DexcaliburProject.setConnector (/home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/DexcaliburProject.js:193:57)
    at /home/axelle/.nvm/versions/node/v12.20.0/lib/node_modules/dexcalibur/src/WebServer.js:419:29
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

@cryptax
Copy link
Contributor Author

cryptax commented Dec 10, 2020

On (1) I believe this is just a doc issue : the main page, README.md, does not say to install Frida. But https://frenchyeti.github.io/dexcalibur-doc/Installation-guide says to install frida-tools + apktool. Just need to know which is the most up to date doc :)

@FrenchYeti
Copy link
Owner

Yes, you are right on (1). My documentation is out dated, and not mention version ! Apktool is now "installed" by dexcalibur. Current requirements are only : nodeJs, frida tools (on host), and java. Other requirements are downloaded by dexcalibur into dexcalibur workspace during first.

Another thing is the latest release on GitHub != NPM. Sorry for that.

In fact, i fully rewrote Dexcalibur and fixed lot of things into new version, however this new version (v1.0) is not yet released. I would like to release it mid-january.

About connectors issue, it's a blocking issue. I will patch it today.

FrenchYeti added a commit that referenced this issue Dec 11, 2020
frida-tools is required on the host - see issue #30
@FrenchYeti
Copy link
Owner

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants