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

相关推荐
国科安芯2 天前
航天电子模拟前端三大支柱:精密运放、高速运放与电压监控的协同设计方法——ASL8522S/ASL622S/ASL706S技术解析
前端·单片机·嵌入式硬件·fpga开发·架构·安全性测试
x-cmd4 天前
Linus 9 年前说「模糊测试有效」——今天已成 OSS-Fuzz 时代铁律
linux·ai·rust·开源·自动化·agent·安全性测试
Luminbox紫创测控5 天前
大面积太阳模拟器设计原理与高均匀度辐照实现方法
人工智能·测试工具·安全性测试·测试标准
BullSmall5 天前
新手做 Fuzz 测试全套注意事项(从零入门避坑版)
安全性测试
糖果店的幽灵6 天前
安全测试从入门到精通-安全测试世界观
安全性测试·安全测试
Luminbox紫创测控7 天前
GB/T 5137.3 2020标准:汽车安全玻璃耐辐照与耐模拟气候试验方法
人工智能·测试工具·汽车·安全性测试·uv·测试标准
国科安芯8 天前
空间在轨服务机器人通信链路中抗辐射收发器的应用研究
网络·数据库·算法·机器人·安全性测试
国科安芯9 天前
航天器多路并联大功率电源系统设计与ASP4644均流特性分析
单片机·嵌入式硬件·fpga开发·安全性测试
介一安全10 天前
【SRC】基础思路篇10:越权与未授权访问完全指南
web安全·安全性测试·src·越权
水龙吟啸1 个月前
机器学习安全:图像多分类任务的测试时对抗样本转移攻击实战(一)
机器学习·图像分类·安全性测试·asr·混淆矩阵·auc·转移攻击