FridaSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
AI 驱动的 Android 动态分析工具。通过 MCP (Model Context Protocol) 让 AI 直接操控 Frida,实现自动化逆向分析。
AI (Claude) → MCP Server → Frida CLI → zygisk-gadget (手机) → 结果返回
前提条件
- Python >= 3.10
- Android 手机已 root,安装 Magisk
- 安装 zygisk-gadget Magisk 模块(固定端口 14725)
- ADB 已连接手机
安装
pip install .
安装后运行一键配置(注册 MCP + 安装 Skills):
frida-mcp-setup
或手动配置,在 ~/.claude.json 中添加:
{
"mcpServers": {
"frida-agent": {
"command": "frida-mcp"
}
}
}MCP Tools
Skills(Claude Code 技能)
安装后可在 Claude Code 中使用:
- `/reverse-analyze` — 逆向分析与动态 Hook,结合 IDA 静态分析 + Frida 动态验证
- `/trace-vm` — VM 保护函数分析,指导人工 trace 并由 AI 分析结果
使用示例
基本 Hook 流程
用户: hook 淘宝的 Cipher.doFinal 看看加密参数
AI 自动执行:
1. connect() — 建立连接
2. spawn_and_inject( — 启动并注入
"com.taobao.taobao",
"Java.perform(function() { ... })"
)
3. 提示用户触发操作 — "请点击登录按钮"
4. get_messages() — 获取 hook 结果
5. 分析并展示加密参数和返回值结合 IDA 静态分析
用户: /reverse-analyze 分析 libsgmain.so 中 0x1234 处的函数 AI 自动执行: 1. IDA MCP 反编译目标函数,分析参数和返回值类型 2. 生成 Frida Hook 脚本 3. spawn_and_inject 注入 4. 交叉验证静态分析和动态结果
工作原理
本工具使用 Frida CLI 而非 frida-python API,通过 frida -H 127.0.0.1:14725 -F -l script.js -o output.txt 注入脚本:
- 脚本中的
send()调用自动转换为console.log(JSON.stringify()) - 所有脚本自动包裹 try-catch 防止注入崩溃
- 输出通过
-o标志写入文件,get_messages时停止 frida 进程以刷新文件
项目结构
src/frida_mcp/ ├── server.py
58d11a19ffd7OBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add frida-agent-mcp -- uvx frida-agent-mcp
{
"mcpServers": {
"frida-agent-mcp": {
"command": "uvx",
"args": [
"frida-agent-mcp"
]
}
}
}Exposed tools (10)
7 read · 1 write · 2 destructive. Blast radius: 2 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
connect | read | Connect to the Frida gadget on the device. |
detach | read | Detach from the current session and unload any injected scripts. |
execute | write | Inject a Frida JavaScript script into the frontmost application. |
get_messages | read | Get messages collected from the injected script |
kill_app | destructive | Force stop an Android app by package name. |
launch_app | read | Launch an Android app by package name. |
list_apps | read | List running applications on the connected device. |
logcat | read | Get Android logcat output. Useful for debugging crashes after script injection. |
reconnect | read | Reconnect to the gadget after an app crash. |
spawn_and_inject | destructive | Kill app, relaunch, connect, and inject script in one step. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- UNDECLARED (1 observation(s))
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (2)
kill_app, spawn_and_inject
Gates applied: no_behavioural_pass, no_license.
58d11a19ffd7full audit observations/trust-audit/mcp-server/1193776794__frida-4.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 58d11a19ffd7 | SAFE | B | 89 | first audit |
Questions
What tools does Frida expose?
10 in total: 7 read-only, 1 that write, and 2 that can delete or overwrite (kill_app, spawn_and_inject). Every one is listed on this page with its risk.
Is Frida safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 2 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Frida need?
No credential environment variables were found in its source, so it appears to need none.
How does Frida run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as frida-agent-mcp.
How current is this page?
The grade is for one exact copy of the source (58d11a19ffd7), read on 2026-10-07. The repository is watched and re-audited when it changes.