← 返回命令列表

Linux command

frida 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Attach

frida [process_name]

Attach

frida -p [pid]

Spawn

frida -f [/path/to/binary]

Load

frida -l [script.js] [process_name]

Attach

frida -U -n [app_name]

Spawn

frida -U -f [com.example.app] --pause

Evaluate

frida -e "console.log('hello')" [process_name]

说明

frida is the interactive REPL (Read-Eval-Print Loop) interface to the Frida dynamic instrumentation toolkit. It allows injecting JavaScript snippets into running processes for runtime analysis, debugging, and modification. You can attach to running processes, spawn new ones, load scripts, hook functions, and inspect or modify application behavior at runtime. Frida works across Windows, macOS, GNU/Linux, iOS, Android, FreeBSD, and QNX. For remote targets (phones, embedded devices), a frida-server binary must be running on the target device.

参数

-f _TARGET_, --file _TARGET_
Spawn FILE as a new process
-F, --attach-frontmost
Attach to the frontmost application
-n _NAME_, --attach-name _NAME_
Attach to process by name
-p _PID_, --attach-pid _PID_
Attach to process by PID
-U, --usb
Connect to USB device
-R, --remote
Connect to remote frida-server
-H _HOST_, --host _HOST_
Connect to remote frida-server on HOST
-D _ID_, --device _ID_
Connect to device with the given ID
-l _SCRIPT_, --load _SCRIPT_
Load JavaScript SCRIPT (may be specified multiple times)
-e _CODE_, --eval _CODE_
Evaluate JavaScript CODE
-c _URI_, --codeshare _URI_
Load script from Frida CodeShare
-C _CMODULE_, --cmodule _CMODULE_
Load a C module
-P _JSON_, --parameters _JSON_
Parameters as JSON, same as Gadget
--runtime {qjs,v8}
Script runtime to use
--debug
Enable Node.js compatible script debugger
-q, --quiet
Quiet mode (no prompt), quit after -l and -e
-t _SECS_, --timeout _SECS_
Seconds to wait before terminating in quiet mode
-o _FILE_, --output _FILE_
Output to log file
--pause
Leave main thread paused after spawning program
--kill-on-exit
Kill the spawned program when Frida exits
--eternalize
Eternalize the script before exit
--auto-perform
Wrap entered code with Java.perform
--no-auto-reload
Disable auto reload of scripts on file change

FAQ

What is the frida command used for?

frida is the interactive REPL (Read-Eval-Print Loop) interface to the Frida dynamic instrumentation toolkit. It allows injecting JavaScript snippets into running processes for runtime analysis, debugging, and modification. You can attach to running processes, spawn new ones, load scripts, hook functions, and inspect or modify application behavior at runtime. Frida works across Windows, macOS, GNU/Linux, iOS, Android, FreeBSD, and QNX. For remote targets (phones, embedded devices), a frida-server binary must be running on the target device.

How do I run a basic frida example?

Run `frida [process_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _TARGET_, --file _TARGET_ do in frida?

Spawn FILE as a new process