Frida

All the following main commands are implemented in HacknDroid.

Installation

  1. Install frida-tools

pip install frida-tools
  1. Identify the current frida version

frida --version

Frida-server setup

  1. Download frida-server for the current version of frida (for Android) from here

  2. Move the frida-server on the mobile device

adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell "su -c '/data/local/tmp/frida-server &'"

Cheat sheet

List applications

Command
Description

frida-ps -U

List apps on USB device

frida-ps -Ua

List apps including system processes

Attaching a running process

Command
Description

frida -U -n <package_name>

Attach by package name

frida -U <pid>

Attach by PID

Spawn an app and inject script immediately

frida -U -f com.example.app -l myscript.js --no-pause

Other frida tools

frida-trace

Trace native open() calls:

frida-trace -U -i "open" <package_name>

Trace Java methods:

frida-trace -U -j -i "java.io.*" <package_name>

Auto-instrument functions by pattern:

frida-trace -U -i "ssl*" <package_name>

REPL

Interactive JS REPL after attach:

frida -U -n <package_name>

frida-compile

Convert JS module into single file to load simpler:

frida-compile script/ -o script.compiled.js

Last updated