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

相关推荐
Luminbox紫创测控4 天前
氙弧老化测试全参数解析:滤镜类型、辐照度与黑标温度设定
人工智能·测试工具·安全性测试·测试标准
介一安全4 天前
【漏洞学习】PHP+Windows环境通用文件上传漏洞深度剖析
windows·web安全·php·文件上传·安全性测试
介一安全5 天前
【漏洞学习】Discuz! 高危设计缺陷深度剖析:Windows短文件名导致数据库泄露
discuz·安全性测试·案例·信息泄漏·短文件名
酿情师5 天前
春秋云境:CVE-2022-30887(文件上传漏洞)复现分析
网络·安全·安全威胁分析·安全性测试·cve
国科安芯6 天前
低噪声LDO如何破解测试测量与医学成像的电源困局
网络·单片机·嵌入式硬件·安全性测试
国科安芯6 天前
基于RISC-V架构的商业航天级MCU国产化技术路径与产业生态研究
网络·分布式·单片机·嵌入式硬件·架构·risc-v·安全性测试
Luminbox紫创测控6 天前
AM0/AM1.5G双标准光谱重构方法及系统实现
人工智能·测试工具·5g·重构·汽车·安全性测试·测试标准
国科安芯6 天前
AS32S601芯片抗辐照性能试验验证与空间环境适应性分析
前端·分布式·单片机·嵌入式硬件·架构·risc-v·安全性测试
国科安芯7 天前
大电流低噪声LDO芯片在商业航天分布式电源架构中的应用分析
网络·分布式·单片机·嵌入式硬件·架构·安全性测试
qq 13740186118 天前
ASTM D4169-23e1 完整版解析|运输集装箱与系统性能测试规程前言
安全性测试·运输测试·astm·包装运输·包装工程