Communitygithub.com

프로토콜 리버스 엔지니어링

사용자 정의 바이너리 프로토콜, Protobuf/gRPC, WebSocket 프레임, PCAP 기반 프로토콜 복원에 대한 승인된 역공학을 수행합니다.

프로토콜 리버스 엔지니어링란 무엇인가요?

이 스킬은 개발자와 보안 연구원이 특정 네트워크 프로토콜의 역공학을 수행할 수 있도록 하는 전문 기술입니다. 사용자 정의 TCP/UDP 바이너리 프로토콜, Protobuf/gRPC, WebSocket/MQTT 프레임, PCAP/PCAPNG 파일에서 프로토콜 상태 머신과 메시지 레이아웃을 복원하는 데 중점을 둡니다. 지원하는 플랫폼은 Claude Code, Cursor, Codex 등이며, 워크플로는 4단계(Phase 1~4)로 구성됩니다: 샘플 수집 및 분류, 프레임 레이아웃 복원, 직렬화 및 암호화 분석, 최종 산출물(메시지 타입 표, 디코딩 스크립트) 생성. 각 단계에서 tshark/Wireshark, blackboxprotobuf, Python3, ImHex 등의 도구를 활용하며, 웹 전용 역공학이나 TLS 인증서 문제 등 다른 상황은 해당 스킬로 라우팅됩니다. 또한 권한 확인과 스코프 준수를 엄격히 요구하며, 관련 스킬(ida-reverse, js-reverse, firmware-pentest 등)과의 연계를 통해 복잡한 역공학 작업을 완료합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/zhaoxuya520/reverse-skill/tree/main/skills/protocol-reverse

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

프로토콜 리버스 엔지니어링은(는) 무엇을 하나요?

필수 조치 사항 (읽은 후 즉시 실행)

  1. 지금: ../field-journal/precedent-reverse.md 읽기 — 권한 및 일반 작업 경계 확인
  2. 지금: 작업이 프로토콜/트래픽/직렬화 형식 역공학인지 확인(순수 웹 파라미터 서명 → js-reverse/로 이동)
  3. 지금: 대상 네트워크 상호작용이 있는 경우 → ../scripts/case-init.ps1 실행하여 스코프 설정; auth가 승인되지 않은 경우 대상에 ACT 금지
  4. 다음: ../tool-index.md 읽기; 도구가 없으면 부트스트랩 (tshark/wireshark 등은 수동 설치 필요)
  5. 실행: 워크플로 Phase 1로 진입, 프레임 레이아웃 또는 메시지 사전 초안 작성

적용 시나리오

  • 사용자 정의 TCP/UDP 바이너리 프로토콜
  • Protobuf / gRPC / FlatBuffers / MessagePack
  • WebSocket / MQTT / 사설 RPC
  • PCAP / PCAPNG로 필드 및 상태 머신 복원
  • 클라이언트-서버 검증, 시퀀스 번호, 암호화된 프레임 헤더

이 스킬을 사용하지 않는 경우

상황이동 대상
HTTP 파라미터 서명 / JS 암호화만 해당js-reverse/
TLS 인증서 문제만 해당pentest-tools/ 또는 브라우저 프록시
펌웨어 내 프로토콜 스택 심층 분석 + 시뮬레이션firmware-pentest/ 후 다시 이 스킬

워크플로

Phase 1 — 수집 및 분류

□ 샘플 확보: PCAP / 프록시 내보내기 / 클라이언트 로그 / 바이너리
□ 방향 표시: C→S / S→C; 핸드셰이크, 하트비트, 재연결 여부
□ 고정 헤더? 매직 넘버? 길이 필드? TLV? 고정 길이?
□ 압축(zlib/gzip/lz4) 또는 암호화(AES/ChaCha 프레임 내부) 여부
□ tshark -r cap.pcap -T fields -e frame.number -e ip.src -e tcp.payload

Phase 2 — 프레임 레이아웃 복원

□ 여러 동일 타입 메시지 정렬, 불변 바이트 / 증가하는 시퀀스 번호 찾기
□ 길이 필드: 빅엔디안/리틀엔디안, 헤더 포함/미포함
□ 체크섬: CRC16/32, checksum, HMAC 위치
□ 상태 머신 그리기: Connect → Auth → Ready → Request/Response → Close
□ 도구: Wireshark 사용자 정의 디섹터 초안 / ImHex / 010 Editor 템플릿 / Kaitai Struct

Phase 3 — 직렬화 및 암호화

□ Protobuf: .proto 복원 (blackboxprotobuf / pbtk / protoc --decode_raw)
□ gRPC: HTTP/2 헤더 + protobuf 본문
□ 암호화: 키 파생 찾기(클라이언트 so/dll/JS) → ida-reverse / js-reverse / apk-reverse와 연계
□ 재생: 권한이 부여된 스코프 내에서만 수행; 무해한 필드부터 시작 후 민감한 작업

Phase 4 — 산출물

필수 산출물:
- 메시지 타입 표 (name / opcode / fields)
- 최소 1개의 재현 가능한 디코딩 명령어 또는 스크립트
- 증거: 원본 hex 발췌 + 디코딩 결과 (비식별화)

도구 체인

도구필수용도부트스트랩
tshark / Wireshark강력 권장PCAP 분석수동 / winget
Python3예디코딩 스크립트시스템
blackboxprotobuf선택알 수 없는 protobufpip
ImHex / 010선택구조 템플릿수동
IDA / r2 / Ghidra필요 시클라이언트 직렬화 함수해당 스킬 참조

참고

  • references/protocol-workflow.md — 프레임 레이아웃 및 Protobuf 빠른 참조
  • 관련: ../ida-reverse/ ../js-reverse/ ../firmware-pentest/ ../pentest-tools/

라우팅 컨텍스트

상위: MASTER-ROUTING R21 · routing.md
하위: 클라이언트 알고리즘 필요 시 → ida-reverse/js-reverse; 재생 활용 필요 시 → pentest-tools/api-security 동급: malware-analysis(C2 프로토콜), digital-forensics(트래픽 포렌식)

작업 완료 자가 점검

  • 메시지 레이아웃 또는 상태 머신을 복원했습니까? (hex만 붙인 것은 아님)
  • 재현 가능한 디코딩 명령어가 있습니까?
  • 스코프/비식별화를 준수했습니까?
  • field-journal / 보고서 Checklist를 작성했습니까?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

attack-chain

Use for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.

binary-diff

|

binary-ninja-reverse

Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.

browser-automation

|

browser-extension-reverse

Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

case-review

Reviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.

cloud-k8s

Use for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.

code-audit

Use for authorized source-code security review and SAST workflows including Semgrep, CodeQL patterns, dangerous API hunting, and fix verification.

ctf-sandbox

Thin PRIMARY for CTF / AWD / 靶场 multi-type orchestration. Hands off to the sidecar CTF-Sandbox-Orchestrator. Use when the user says CTF, AWD, 靶场, or 比赛题 and no more specific pwn/APK/IDA route already won.

database-security

Use for authorized database security assessment covering PostgreSQL/MySQL/MSSQL/Mongo/Redis exposure, authz, UDF/command paths, and misconfiguration review.

diagram-generator

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

digital-forensics

Use for authorized digital forensics including memory dumps, disk timelines, PCAP investigation, artifact triage, and IR evidence preservation.

docs-generator

|

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。

edr-bypass-re

|

email-security

Use for authorized email security review including phishing analysis, header authentication (SPF/DKIM/DMARC), BEC patterns, and mailbox token abuse research.

firmware-pentest

|

ghidra-reverse

Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.

관련 스킬