JEB MCP服务器
一个模型上下文协议(MCP)服务器,将Claude Desktop与JEB反编译器连接起来,用于Android APK分析。这种集成使人工智能辅助的逆向工程工作流程直接在Claude中实现。
特性
- 反编译:将DEX中的方法和类分解为Java源代码
- 代码导航:列出类、搜索资源并探索交叉引用
- 批量重命名:批量重命名类、方法、字段和局部变量
- 资源分析:访问AndroidManifest.xml、资源和资产文件
- 参见项:查找对方法、字段和字符串的所有引用
- 类层次结构:探索类实现和继承
建筑
该系统由两部分组成:
- JEB MCP服务器 (
dJEB_mcp_server.py):作为Jython脚本在JEB内部运行,通过套接字公开JEB的API - 桥梁脚本 (
jeb_mcp_bridge.py):通过stdio将Claude Desktop连接到JEB服务器
Claude Desktop jeb_mcp_bridge.py (port 8851) dJEB_mcp_server.py (JEB)安装
先决条件
- JEB反编译器(许可版本)
- 克劳德桌面
设置
- 克隆此存储库:
git clone https://github.com/yourusername/jeb-mcp-server.git
cd jeb-mcp-server- 配置Claude桌面:
编辑您的Claude Desktop MCP配置文件:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 视窗: %APPDATA%/Claude/claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"jeb-mcp-server": {
"command": "python3",
"args": ["/absolute/path/to/jeb-mcp-server/jeb_mcp_bridge.py"]
}
}
}- 在JEB中加载脚本:
- 打开JEB反编译器 - 加载您的目标APK文件 - 运行脚本: File → Scripts → Run Script... → 选择 dJEB_mcp_server.py - 服务器将开始监听端口8851
- 重新启动克劳德桌面 加载MCP服务器配置
用法
配置后,您可以使用自然语言通过Claude Desktop与JEB进行交互。服务器提供以下工具:
可用工具
| 工具 | 说明 |
|---|---|
decompile_method | 将特定方法分解为Java源代码 |
decompile_class | 将整个类分解为Java源代码 |
list_classes | 列出所有具有可选过滤和分页的类 |
implements_of_class | 获取类/接口的所有实现 |
get_xrefs | 获取方法、字段或字符串的交叉引用 |
batch_rename | 一次重命名多个类、方法和字段 |
batch_rename_local_variables | 跨多个方法重命名局部变量 |
get_manifest_file | 检索并搜索AndroidManifest.xml |
get_resource_file | 访问资源文件(布局、字符串等) |
search_resources | 使用正则表达式模式搜索资源文件 |
示例提示
以下是您可以在JEB MCP服务器上使用的强大提示:
1.深度链接分析
提示:
Analyze the deep-link handling in this Android application step-by-step.
I want you to:
1. Find all activities that handle intent filters with data schemes
2. For each deep-link handler, trace the URL parsing logic
3. Extract all possible endpoints and their parameters
4. Ignore any analytics or tracking code
5. Create a comprehensive map of all deep-link endpoints with their functionality
Please be thorough and explore all related classes.2.智能类重命名
提示:
I want to rename the obfuscated class "La/b/c;" and its methods to meaningful names.
Please:
1. Decompile the class and analyze its purpose
2. Find all classes that reference or are referenced by this class
3. Examine the broader context by looking at:
- Parent classes and interfaces
- Classes that call its methods
- Classes instantiated within it
4. Only rename elements you're confident about based on:
- Method functionality
- String constants used
- Android framework patterns
- Common design patterns
5. Provide the rename mappings with explanations
6. Execute the batch rename operation
Be conservative - only rename what you're certain about.3.API端点提取
提示:
Extract all REST API endpoints used by this application.
Please:
1. Find all HTTP client usage (Retrofit, OkHttp, HttpURLConnection, etc.)
2. Locate API interface definitions or base URL constants
3. For each endpoint, extract:
- HTTP method (GET, POST, etc.)
- Full URL path
- Request parameters
- Response handling
4. Group endpoints by feature/module
5. Create an API documentation with examples
Focus on actual API calls, ignore logging or analytics.4.广播接收机分析
提示:
Analyze all broadcast receivers in this application.
For each receiver:
1. Identify what intents it listens for
2. Explain what actions it performs
3. Check if it's exported and the security implications
4. Find where broadcasts are sent from within the app
5. Map the complete broadcast communication flow
Document any security concerns with exported receivers.5.交叉引用追踪
遵循执行流程:
"Starting from the MainActivity onCreate method, trace all
method calls related to user login, and map the complete
authentication flow with all classes involved."贡献
欢迎投稿!请随时提交问题或拉取请求。
发展
代码库由以下部分组成:
- Jython代码 (
dJEB_mcp_server.py):在JEB的Jython环境中运行 - Python 3代码 (
jeb_mcp_bridge.py):标准Python stdio桥
贡献时:保持与JEB Jython 2.7环境的兼容性
许可证
MIT许可证-有关详细信息,请参阅许可证文件
致谢
支持
对于问题、疑问或功能请求,请在GitHub上打开问题。
______________________________________________________________________
备注:这是一个非官方工具,不隶属于PNF Software或Anthropic,也不受其认可。
