Mac下IDA pro 9.2 MCP+Opencode自动逆向

1、安装opencode 官网命令行版

2、安装idapro 9.2 百度网盘下载 + 破解版py

3、Python 3.11以上版本-注意插件找不到多半这个问题

4、遇到问题可以直接让opencdoe来解决

安装opencode

复制代码
curl -fsSL https://opencode.ai/install | bash

安装idapro 9.2 for mac

复制代码
通过网盘分享的文件:20251222-IDA9.2全系统安装包
链接: https://pan.baidu.com/s/1QX97EJoLou3YwdBbY3PhfA?pwd=atst 提取码: atst 
--来自百度网盘超级会员v9的分享

配置IDA PRO MCP

首先下载MCP:

项目地址:https://github.com/mrexodia/ida-pro-mcp

功能:与IDApro实现联动,实现自动化分析

复制代码
官方支持的mcpgo工具:
Python (3.11 or higher)
Use idapyswitch to switch to the newest Python version
IDA Pro (8.3 or higher, 9 recommended), IDA Free is not supported
Supported MCP Client (pick one you like)
Amazon Q Developer CLI
Augment Code
Claude
Claude Code
Cline
Codex
Copilot CLI
Crush
Cursor
Gemini CLI
Kilo Code
Kiro
LM Studio
Opencode
Qodo Gen
Qwen Coder
Roo Code
Trae
VS Code
VS Code Insiders
Warp
Windsurf
Zed
Other MCP Clients: Run ida-pro-mcp --config to get the JSON config for your client.

下载安装

复制代码
pip install https://github.com/mrexodia/ida-pro-mcp/archive/refs/heads/main.zip

Configure the MCP servers and install the IDA Plugin:

ida-pro-mcp --install

IDA Pro 中配置MCP

配置成功后会显示MCP服务端口:

Opencode配置MCP:

  1. OpenCode 的配置文件在 ~/.config/opencode/opencode.json

完整配置步骤

步骤 1: 添加 MCP 配置到 OpenCode

复制代码
vim  .config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "superpowers@git+https://github.com/obra/superpowers.git",
    "oh-my-openagent"
  ],
  "mcp": {
    "ida-pro": {
      "type": "remote",
      "url": "http://127.0.0.1:13337/sse",
      "enabled": true
    }
  }
}

配置已添加。

步骤 2: 重启 OpenCode

重启 OpenCode 应用,让配置生效

步骤 3: 验证连接

复制代码
/mcps

举例分析-提示词

题目1:crackme03

CTF题目:https://github.com/mrexodia/mcp-reversing-dataset/blob/master/VEHMeme/README.md

复制代码
crackme03
This is a CTF challenge from a few years ago by Brit and xenocidewiki.


Prompt
You task is to analyze a crackme in IDA Pro. You can use the MCP tools to retrieve information. In general use the following strategy:

Makes sure to analyze all entry points
Inspect the decompilation and add comments with your findings
Rename variables to more sensible names
Change the variable and argument types if necessary (especially pointer and array types)
Change function names to be more descriptive
If more details are necessary, disassemble the function and add comments with your findings
NEVER convert number bases yourself. Use the convert_number MCP tool if needed!
Create a report.md with your findings and steps taken at the end
Input
VEHMeme.exe
Model
Claude 3.7 Sonnet (Roo Cline)

或者直接提示:
请帮我分析ida pro打开的密码检查程序(二进制文件)的分析过程crackme03.elf。目标是了解该程序如何验证密码并确定正确的密码。

得到结果

题目2:pwn 2000pt

分析ida pro打开的pwn题目,帮我查看name和pass1,得到flag,输出验证脚本

复制代码
 PWN2000 Writeup
题目信息

- **题目文件**: pwn
- **架构**: 32位 x86
- **保护**: 待分析
- **flag文件**: flag{656640cec016d8c554929a9903074048}

 分析过程

1. 基础信息收集

使用IDA Pro打开pwn.i64,静态分析得到:
- 程序入口: 0x80490c0 (_start)
- 主要函数: main, login, welcome
- 使用函数: printf, scanf, puts, system, exit

 2. 函数分析

main函数 (0x8049307)


int main() {
    welcome();
    login();
    puts("Now u get in :)");
    return 0;
}


 login函数 (0x80491d2) - 核心函数


int login() {
    int v1;  // [esp+8h] [ebp-10h]
    int v2;  // [esp+Ch] [ebp-Ch]
    
    printf("enter pass1 : ");
    scanf("%d", &v1);
    fflush(stdin);
    
    printf("enter pass2 : ");
    scanf("%d", &v2);
    
    puts("checking...");
    
    if (v2 != 9999 || v1 != 1234) {
        puts("Login Failed!");
        exit(0);
    }
    
    puts("Login !");
    return system("/bin/cat flag");
}


 3. 漏洞分析

**漏洞类型**: 无保护验证 + 命令执行

分析:
- pass1需要输入1234
- pass2需要输入9999
- 验证通过后直接执行 `system("/bin/cat flag")`
- 没有栈保护,可以溢出但不需要

 4. 解题payload

python
#!/usr/bin/env python3
from pwn import *

p = process('./pwn')
p.sendline(b'1234')  # pass1
p.sendline(b'9999')  # pass2
output = p.recvall().decode()
print(output)


 总结

题目为简单PWN,考察静态分析能力。通过反编译直接得出答案:
- pass1 = 1234
- pass2 = 9999

输入正确后程序会读取flag文件内容。

reverse :flag 250pt

分析ida pro打开的可执行程序获取flag

参考链接

https://www.cnblogs.com/alexander17/p/19089720

相关推荐
水龙吟啸8 天前
机器学习安全:图像多分类任务的测试时对抗样本转移攻击实战(一)
机器学习·图像分类·安全性测试·asr·混淆矩阵·auc·转移攻击
Luminbox紫创测控12 天前
金属卤素灯工作原理与汽车零部件老化测试应用
测试工具·汽车·安全性测试·测试标准
国科安芯13 天前
商业航天通信载荷数字处理单元供电架构研究——基于ASP7A84AS的高精度低压差线性稳压器技术分析
前端·单片机·嵌入式硬件·fpga开发·架构·安全性测试
大棉花哥哥13 天前
Cybellum之Products(产品管理)模块技术详解
安全性测试·车联网
Luminbox紫创测控13 天前
AM1.5G光谱在LED太阳模拟器中的工程实现:光谱匹配与均匀性优化(A+级指标)
人工智能·测试工具·5g·安全性测试
大棉花哥哥15 天前
Cybellum 固件包上传扫描流程操作手册
网络·安全性测试
暗冰ཏོ16 天前
软件测试完整学习指南:从入门到自动化、性能与安全测试实战
软件测试·功能测试·单元测试·集成测试·压力测试·测试·安全性测试
明航咨询—张老师16 天前
安全左移的利器:CISAW-SS安全软件认证如何重塑开发安全基因?
软件工程·安全架构·安全性测试
国科安芯17 天前
商业航天级抗辐照全双工RS-485/RS-422收发器ASM491S2Y的技术特性与应用研究
运维·网络·单片机·嵌入式硬件·安全·架构·安全性测试
国科安芯17 天前
国科安芯推出商业航天级抗辐照全双工 RS485/422 收发器 ASC491S2Y
网络·分布式·单片机·架构·安全性测试