Re go

From dslsdzc/rev-skills · View interactive version

Re go is an AI agent skill from the GitHub repository dslsdzc/rev-skills. Go 二进制逆向:符号保留、字符串表、goroutine。触发词:Go、golang、Go二进制、goroutine、go build

How to use this skill

Skill file

Go 二进制逆向(符号 / 字符串表 / goroutine)

何时使用 / 何时不用

工具准备

参考 [[re-analyze/platform-tips]]——Go 二进制通常 1MB 起(runtime 占大头),遵循「静态优先(大型样本)」;动态(dlv/gdb 运行样本)默认进沙箱。

Go 工具链(go version / go tool buildid / go version -m)

Ghidra(内置 Go 支持)与 Go 插件

GoReSym(strip 后符号恢复,可选但关键)

redress(Go 二进制元数据,可选)

garble —— Go 混淆识别(恶意样本常见,无独立工具)

bloaty(体积分析,可选)

操作步骤

按顺序执行,每步记录证据(路径 + sha256,见 [[re-triage]])。

  1. 识别 Go 二进制:

```sh

file sample # 含 "Go BuildID=..." 即 Go(通常静态链接)

readelf -S sample | grep -i go # .go.buildinfo / .gopclntab / .gosymtab

nm sample | grep -E 'main\.main|runtime\.main' # 符号存在性

```

  1. Go 版本指纹:

```sh

go tool buildid sample # build ID(go build 唯一标识,一直可用)

go version -m sample # Go 1.18+:Go 版本 + module 路径 + 依赖列表

strings sample | grep -E '^go1\.[0-9]+' # 旧版兜底:runtime.buildVersion

```

  1. 符号表利用:
  1. 字符串表:

```sh

strings -n 6 sample | grep -E '^main\.|/.*\.go' # 函数名与源文件路径

strings sample | grep -E 'go1\.|module |\.go$'

```

  1. goroutine/调度器理解:
  1. 运行时结构要点(pclntab / goroutine 栈 / buildinfo):

跨域联合

常见坑与陷阱

(来源:reverse-skill field-journal,MIT)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.