Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/rule_mapping.md
Open on GitHub

What 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.md

The paths frontmatter field limits the files

Step 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

Similar IDE rules

All IDE rules for Security →

From the same set22

The whole set →
c2_evasion c2_evasion examines C2 framework source code, locates detection rules (YARA, Sigma), and suggests modifications to bypass signatures. Takes a path to the source as an argument. CX Codex +1 ★ 336repo stars loader_generate loader_generate spawns an agent to assemble and compile C, C++, or Rust shellcode loaders from a techniques knowledge base. CX Codex +1 ★ 336repo stars rule_inventory The rule_inventory rule catalogues YARA indicators for Stowaway, including binary names, strings, paths, command-line patterns, and hashes. Use it when checking samples for those indicators. CX Codex +1 ★ 336repo stars tool_profile tool_profile — a Claude rule that profiles Stowaway: what the Go multi-hop proxy is built from, how it compiles, and which traces it leaves on a host. CX Codex +1 ★ 336repo stars tools_evasion The tools_evasion command examines a penetration-testing tool, gathers detection rules, then changes its source code to avoid those rules. It is intended for authorized security work. CX Codex +1 ★ 336repo stars rule_inventory A rule file that gives the agent an inventory of SharpHound detections: three YARA rules, one Sigma rule, pattern tables and a difficulty rating for each. CX Codex +1 ★ 336repo stars hex_analysis hex_analysis — a rule file that explains YARA hex signatures for AdaptixC2: which instruction produced each one and which compiler flag moves those bytes. CX Codex +1 ★ 336repo stars lesson_learned The lesson_learned rule explains why string constants must match fixed-width protocol fields. Use it when changing Go code that reads message headers into fixed-size buffers. CX Codex +1 ★ 336repo stars

Project sponsors

Companies that keep this analytics open