rule_mapping — Claude Code rule: AdaptixC2 detection signature analysis
rule_mapping is a Claude Code rule that analyzes YARA and Sigma signatures for AdaptixC2. It helps assess which signatures are outdated during detection rule reviews.
MIT ★ 336 updated 2026-04-09
.claude/rules/rule_mapping.mdWhat rule_mapping does
The rule dissects four sets of detection signatures: Elastic (hex patterns in beacon_agent functions), bartblaze (Go symbols now renamed in current versions), nembo81 (HTTP headers), and Sigma (hash-based). Each maps to either the Windows-only C++ beacon_agent or the cross-platform Go gopher_agent component.
For each signature, specific actions are listed: adjust Makefile optimization flags to change function prologue hex patterns, skip already-obsolete Go symbols, or modify the X-Beacon-Id HTTP header. Tables show raw patterns, their type (hex, string, regex), and why they trigger.
This rule serves as a reference guide placed in .claude/rules/ within a project. It expects familiarity with YARA syntax and signature evasion basics. Equivalent versions exist for Cursor, GitHub Copilot, Windsurf, and Cline in their respective rule directories.
What it helps with
- locate active detection signatures targeting a C2 framework
- determine which hex patterns have already been evaded in current implant versions
- identify which compiler flags alter binary signatures without breaking functionality
- rewrite HTTP headers to bypass string-based detection rules
Example prompts for the agent
- Analyze new YARA rules for updated beacon_agent binaries and map evasion approaches
- Review whether -O2 -fomit-frame-pointer flags will sufficiently change the function prologue pattern
- Rename X-Beacon-Id to a custom header matching a different regex pattern than /X-[0-9a-zA-Z]{3,10}-Id/
How to install rule_mapping
Manually: put the files in place
.claude/rules/rule_mapping.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/rule_mapping.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/rule_mapping.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/rule_mapping.mdManually: put the files in place
.clinerules/rule_mapping.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about rule_mapping
How do I install rule_mapping in Claude Code?
Place the rule file at .claude/rules/rule_mapping.md in your project directory. Claude Code automatically loads rules from this folder in the next session.
What does rule_mapping do?
It catalogs known YARA and Sigma detection rules for AdaptixC2, explains which hex patterns and strings they match, and provides concrete evasion steps—from changing compiler flags to renaming HTTP headers.
Which implant versions does this rule cover?
Beacon_agent (C++, Windows only) and gopher_agent (Go, cross-platform). The rule notes that the bartblaze rule is outdated because the current version has already renamed the Go function symbols it targets.
Source text
rule_mapping.md · MIT
# AdaptixC2 Rule Mapping
## Overview
**C2 Framework:** AdaptixC2
**Implant Types:**
- `beacon_agent` (C++ - Windows only)
- `gopher_agent` (Go - Cross-platform)
**Detection Rules Found:**
- Windows_Trojan_Adaptix_Elastic.yar (2 rules, hex patterns)
- Adaptix_Beacon_bartblaze.yar (string patterns - Go function names)
- AdaptixC2_nembo81.yar (string patterns - HTTP headers)
- AdaptixC2.yml (Sigma - hash/keyword based)
---
## Rule 1: Windows_Trojan_Adaptix_2779784c (Elastic)
### Pattern Analysis
| Pattern | Type | Meaning | Source Cause | Target |
|---------|------|---------|--------------|--------|
| $a1 = { 48 81 EC A8 01 00 00 ... } | hex | Function prologue: sub rsp, 0x1A8 | Large stack allocation | beacon_agent (C++) |
| $a2 = { 48 83 EC 58 48 8B 4C 24 70 ... } | hex | Function prologue: sub rsp, 0x58 | Stack allocation | beacon_agent (C++) |
### Evasion Strategy
**Primary: Compiler Flags** (Priority 1)
- Modify beacon_agent Makefile to change optimization levels
- Add -O2 -fomit-frame-pointer to alter function prologues
---
## Rule 2: Windows_Trojan_Adaptix_b2cda978 (Elastic)
### Pattern Analysis
| Pattern | Type | Meaning | Source Cause |
|---------|------|---------|--------------|
| $a1 = { 48 89 03 8B 45 EC 48 98 ... } | hex | Code sequence | Compiled beacon code |
| $a2-$a5 | hex | Code sequences | Compiled beacon code |
### Evasion Strategy
**Primary: Compiler Flags** - Same as Rule 1
---
## Rule 3: Adaptix_Beacon (bartblaze)
### Pattern Analysis
| Pattern | Type | Target | Status |
|---------|------|--------|--------|
| $coffer = "coffer.Load" | string | Go symbol | NOT FOUND |
| $func_TaskProcess = "main.TaskProcess" | string | Go symbol | NOT FOUND |
| $func_jobRun = "main.jobRun" | string | Go symbol | NOT FOUND |
| (all other func_ patterns) | string | Go symbols | NOT FOUND |
### Conclusion
**The bartblaze rule targets an OLDER VERSION of AdaptixC2.** The current version has already renamed these functions.
---
## Rule 4: backdoor_AdaptixC2_http_beacon (nembo81)
### Pattern Analysis
| Pattern | Type | Source Location |
|---------|------|-----------------|
| $b1 = "AdaptixC2" | string | gopher_listener_tcp/ax_config.axs:26 (server-side) |
| $b2 = "X-Beacon-Id" | string | beacon_listener_http/ax_config.axs:38 |
| $d1 = /X-[0-9a-zA-Z]{3,10}-Id/ | regex | HTTP header pattern |
### Evasion Strategy
1. "AdaptixC2" - Server-side only - SKIP
2. "X-Beacon-Id" - HTTP header - MODIFY
---
## Summary
| Rule | Type | Target | Action |
|------|------|--------|--------|
| Windows_Trojan_Adaptix (Elastic) | Hex | beacon_agent | Modify Makefile flags |
| Adaptix_Beacon (bartblaze) | String | gopher_agent | SKIP (already evaded) |
| AdaptixC2_nembo81 | String | HTTP header | Modify X-Beacon-Id |
| AdaptixC2.yml (Sigma) | Hash | Post-compilation | SKIP |
© JDArmy · MIT · JDArmy/Evasion-SubAgents