diff --git a/skills/config/routing.json b/skills/config/routing.json index 2f82317..7e0a17a 100644 --- a/skills/config/routing.json +++ b/skills/config/routing.json @@ -58,7 +58,8 @@ "label": "radare2", "skill": "radare2/SKILL.md", "keywords": [ - { "must": "radare|\\br2\\b" } + { "must": "radare|\\br2\\b" }, + { "must": "r2xsql|r2mcp|r2http|radius2|r2pm|rabin2|rasm2|radiff2|rahash2|rax2" } ] }, "R8": { diff --git a/skills/radare2/SKILL.md b/skills/radare2/SKILL.md index 62fe41f..d462897 100644 --- a/skills/radare2/SKILL.md +++ b/skills/radare2/SKILL.md @@ -381,6 +381,27 @@ rax2 -s hello - 命令速查:`references/cheatsheet.md` - 标准侦察脚本:`scripts/recon.ps1` +## radare2-skills 生态 + +radare2-skills 项目(radareorg/radare2-skills)提供了更完整的生态工具和工作流: + +- **r2xsql**:SQL 查询二进制导入表 / 字符串 / 函数 +- **r2mcp / r2http**:MCP 工具与 HTTP 状态化命令通道 +- **radius2**:符号执行、符号动态分析 +- **r2pm**:插件管理、扩展 +- **decompiler plugins**:radare2 插件机制 + +**使用策略**: +- 当用户提到 `r2xsql`、`r2mcp`、`r2http`、`radius2`、`r2pm`、`rabin2`、`rasm2`、`radiff2`、`rahash2`、`rax2` 时,优先路由到本 skill(radare2/SKILL.md) +- 这些工具只是生态加速器,**不能绕过**:授权门禁、`tool-index` 校验、Evidence 导入、写模式确认 +- 给出最小可复现命令示例: + - `r2xsql -s -q "SELECT ..."` + - `curl.exe -sS --data-binary 'aaa' http://127.0.0.1:9393/cmd` + - `radius2 -p ...` + - `r2pm -ci ` + +本 skill 保持原有硬门禁和证据链完整性,不允许跳过任何授权或 Evidence 步骤。 + --- ## 路由上下文 @@ -394,8 +415,6 @@ rax2 -s hello **同级关联模块**: `ida-reverse/`(互补:r2 侦察快,IDA 反编译深) ---- - ## 按需自举(On-Demand Bootstrap) 本 skill 的入口脚本已接入统一自举系统。缺少 radare2 时不会直接报错,而是自动尝试安装。 diff --git a/skills/radare2/references/cheatsheet.md b/skills/radare2/references/cheatsheet.md index 30c912f..a1480ab 100644 --- a/skills/radare2/references/cheatsheet.md +++ b/skills/radare2/references/cheatsheet.md @@ -95,3 +95,35 @@ rax2 0x401000 rax2 4198400 rax2 -s hello ``` + +## radare2-skills 生态命令 + +### r2xsql 查询示例 + +```powershell +r2xsql -s sample.exe -q "SELECT name, module FROM imports WHERE name LIKE '%Crypt%'" +r2xsql -s sample.exe -q "SELECT addr, content FROM strings WHERE content LIKE '%http%'" +``` + +### r2http / r2mcp 会话 + +```powershell +r2 -N -e http.bind=localhost -e http.port=9393 -e http.sandbox=false -q -c=h sample.exe +curl.exe -sS --data-binary 'aaa' http://127.0.0.1:9393/cmd +curl.exe -sS --data-binary 'aflj' http://127.0.0.1:9393/cmd +``` + +### radius2 符号执行 + +```powershell +radius2 -p sample.exe -s stdin 96 -X Incorrect +radius2 -p sample.exe -s flag 256 -A . flag -B Correct -X Wrong -j +``` + +### r2pm 插件安装 + +```powershell +r2pm -ci r2ghidra +r2pm -ci r2dec +r2pm -l +``` diff --git a/skills/scripts/lib/ToolDiscovery.ps1 b/skills/scripts/lib/ToolDiscovery.ps1 index ddaa91d..f81129b 100644 --- a/skills/scripts/lib/ToolDiscovery.ps1 +++ b/skills/scripts/lib/ToolDiscovery.ps1 @@ -199,6 +199,66 @@ function Get-ReverseToolCatalog { [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\rax2.exe' } ) } + [pscustomobject]@{ + Name = 'r2pm' + Skill = 'radare2' + Purpose = 'radare2 插件管理' + VersionArgs = @('-v') + Fallbacks = @( + [pscustomobject]@{ Type = 'command'; Value = 'r2pm' }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\bin\r2pm.exe') }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\r2pm.exe') }, + [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\r2pm.exe' } + ) + } + [pscustomobject]@{ + Name = 'r2xsql' + Skill = 'radare2' + Purpose = 'radare2 SQL 查询工具' + VersionArgs = @('--version') + Fallbacks = @( + [pscustomobject]@{ Type = 'command'; Value = 'r2xsql' }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\bin\r2xsql.exe') }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\r2xsql.exe') }, + [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\r2xsql.exe' } + ) + } + [pscustomobject]@{ + Name = 'r2xsql-full' + Skill = 'radare2' + Purpose = 'radare2 SQL 查询工具(完整版)' + VersionArgs = @('--version') + Fallbacks = @( + [pscustomobject]@{ Type = 'command'; Value = 'r2xsql-full' }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\bin\r2xsql-full.exe') }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\r2xsql-full.exe') }, + [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\r2xsql-full.exe' } + ) + } + [pscustomobject]@{ + Name = 'r2mcp' + Skill = 'radare2' + Purpose = 'radare2 MCP 协议分析' + VersionArgs = @('-v') + Fallbacks = @( + [pscustomobject]@{ Type = 'command'; Value = 'r2mcp' }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\bin\r2mcp.exe') }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\r2mcp.exe') }, + [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\r2mcp.exe' } + ) + } + [pscustomobject]@{ + Name = 'radius2' + Skill = 'radare2' + Purpose = 'radare2 符号执行与动态分析' + VersionArgs = @('-v') + Fallbacks = @( + [pscustomobject]@{ Type = 'command'; Value = 'radius2' }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\bin\radius2.exe') }, + [pscustomobject]@{ Type = 'path'; Value = (Join-Path $userProfile 'Tools\radare2\radius2.exe') }, + [pscustomobject]@{ Type = 'path'; Value = 'C:\Tools\radare2\bin\radius2.exe' } + ) + } [pscustomobject]@{ Name = 'python' Skill = 'reverse-engineering' diff --git a/skills/scripts/refresh-tool-index.ps1 b/skills/scripts/refresh-tool-index.ps1 index ea5ccb5..ef62cbd 100644 --- a/skills/scripts/refresh-tool-index.ps1 +++ b/skills/scripts/refresh-tool-index.ps1 @@ -34,6 +34,11 @@ $scriptRefs = @{ 'radiff2' = @('radare2/SKILL.md') 'rahash2' = @('radare2/SKILL.md') 'rax2' = @('radare2/SKILL.md') + 'r2pm' = @('radare2/SKILL.md') + 'r2xsql' = @('radare2/SKILL.md') + 'r2xsql-full' = @('radare2/SKILL.md') + 'r2mcp' = @('radare2/SKILL.md') + 'radius2' = @('radare2/SKILL.md') 'python' = @('apk-reverse/scripts/frida-run.ps1', 'case-review/scripts/review_case.py') 'pip' = @() 'node' = @('js-reverse/SKILL.md') diff --git a/skills/tests/routing-benchmark.json b/skills/tests/routing-benchmark.json index def3977..8216932 100644 --- a/skills/tests/routing-benchmark.json +++ b/skills/tests/routing-benchmark.json @@ -116,14 +116,29 @@ "expect": "R6", "quick": false }, + { + "hint": "r2 disassemble", + "expect": "R6", + "quick": false + }, { "hint": "radare2 analyze binary", "expect": "R7", "quick": true }, { - "hint": "r2 disassemble", - "expect": "R6", + "hint": "r2xsql query imports", + "expect": "R7", + "quick": false + }, + { + "hint": "radius2 solve crackme", + "expect": "R7", + "quick": false + }, + { + "hint": "r2mcp analyze binary", + "expect": "R7", "quick": false }, {