modifications_summary · jdarmy, adaptixc2 — Claude Code rule: what it does, how to install
modifications_summary keeps a record of the AdaptixC2 YARA-evasion edits in front of Claude: beacon build flags, renamed Go functions and the commands that verify them. Useful when you pick the repo back up.
MIT ★ 336 updated 2026-04-09
.claude/rules/modifications_summary.mdWhat modifications_summary does
The modifications_summary rule is a markdown file that Claude keeps in context while you work in the repo. It records the 2026-03-18 edits to AdaptixC2: a table of YARA rules from Elastic Security, bartblaze, enzok/CAPE and nembo81, the changes made to the C++ beacon and the Go agent, plus strings and xxd checks for the result.
On the beacon side, beacon_agent/src_beacon/Makefile gains flags such as -fno-inline-functions-small, -fno-expensive-optimizations and -fno-tree-loop-vectorize, while -fno-unwind-tables moves into EVASION_FLAGS. The Go agent gets 29 renamed functions in gopher_agent/src_gopher/tasks.go (CmdProc → DataProc, fRead → opRead), PIE builds via -buildmode=pie, no build ID, -H=windowsgui on Windows, and an updated call in main.go.
The file applies none of this by itself. Nothing reaches the binary until you rebuild the implants, so treat it as a record of work already done. X-Beacon-Id is set in the listener config through hb_header, not compiled into the beacon.
What it helps with
- trace which compiler flags already went into the beacon
Makefile - map an old Go function name to its renamed version
- see which YARA rules are only partly covered
- restore the edit history before rebuilding the implants
- tell implant changes apart from the untouched server components
Example prompts for the agent
- List the flags added to
beacon_agent/src_beacon/Makefileand what each one changes in the build. - Which functions in
gopher_agent/src_gopher/tasks.gowere renamed, and what replacedfRead? - Which YARA rules are only partly covered, and what blocks the rest?
How to install modifications_summary
Manually: put the files in place
.claude/rules/modifications_summary.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/modifications_summary.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/modifications_summary.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/modifications_summary.mdManually: put the files in place
.clinerules/modifications_summary.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about modifications_summary
How do I install modifications_summary in Claude Code?
Copy the file into your project at .claude/rules/modifications_summary.md.
What does modifications_summary cover?
The 2026-03-18 edits to AdaptixC2: compiler flags for the C++ beacon, 29 renamed Go functions with new build flags, a YARA rule breakdown and verification commands.
Does renaming the Go functions change the agent protocol?
No. The names are internal, command handling stays the same, and only the call in main.go moved to DataProc.
Source text
modifications_summary.md · MIT
## AdaptixC2 Evasion Modifications Summary ### Date: 2026-03-18 ### Target: AdaptixC2 Framework --- ## Detection Rules Analyzed ### YARA Rules | Rule File | Author | Patterns | Target | |-----------|--------|----------|--------| | Windows_Trojan_Adaptix_2779784c.yar | Elastic Security | 2 hex patterns | C++ Beacon | | Windows_Trojan_Adaptix_b2cda978.yar | Elastic Security | 5 hex patterns | C++ Beacon | | Adaptix_Beacon.yar | bartblaze | 24 string patterns | Go Agent | | AdaptixBeacon_CAPE.yar | enzok/CAPE | 7 hex patterns | C++ Beacon | | adaptixC2_yara.yar | nembo81 | 5 string/regex patterns | Network | --- ## Modifications Applied ### 1. C++ Beacon Agent (beacon_agent/src_beacon) **File Modified:** `Makefile` **Changes:** - Added additional evasion compiler flags to change code generation patterns - Added `-fno-inline-functions-small` - Added `-fno-inline-functions-called-once` - Added `-fno-expensive-optimizations` - Added `-fno-tree-loop-vectorize` - Added `-fno-tree-slp-vectorize` - Added `-fno-tree-vect-loop-version` - Moved `-fno-unwind-tables` and `-fno-asynchronous-unwind-tables` to EVASION_FLAGS **Rationale:** The Elastic YARA rules detect specific hex patterns generated by the compiler. These flags change instruction ordering, stack allocation patterns, and function inlining behavior, which alters the compiled binary's hex signatures. --- ### 2. Go Agent (gopher_agent/src_gopher) #### 2.1 Function Renaming (tasks.go) **Rationale:** The bartblaze YARA rule detects Go function names embedded in the binary's symbol table. Renaming functions breaks this detection. | Original Function | New Function | Purpose | |-------------------|--------------|---------| | `CmdProc` | `DataProc` | Main command processor | | `jobGetFile` | `xferGet` | File download job | | `jobExec` | `runExec` | Command execution job | | `jobExecObjAsync` | `runObjAsync` | Async BOF execution | | `jobSock` | `runSock` | Tunnel socket job | | `jobShell` | `runShell` | Terminal shell job | | `fRead` | `opRead` | Read file operation | | `fChdir` | `opChdir` | Change directory | | `fCopy` | `opCopy` | Copy file | | `fExecObj` | `opExecObj` | Execute BOF | | `fTerm` | `opTerm` | Terminate agent | | `fListJobs` | `opListJobs` | List running jobs | | `fStopJob` | `opStopJob` | Stop a job | | `fKillProc` | `opKillProc` | Kill process | | `fList` | `opList` | List directory | | `fMkDir` | `opMkDir` | Make directory | | `fMove` | `opMove` | Move file | | `fProcs` | `opProcs` | List processes | | `fCwd` | `opCwd` | Get current directory | | `fRevert` | `opRevert` | Revert token | | `fRemove` | `opRemove` | Remove file | | `fCapture` | `opCapture` | Screenshot | | `fExec` | `opExec` | Execute command | | `fStopTerm` | `opStopTerm` | Stop terminal | | `fStopTun` | `opStopTun` | Stop tunnel | | `fPauseTun` | `opPauseTun` | Pause tunnel | | `fResumeTun` | `opResumeTun` | Resume tunnel | | `fWrite` | `opWrite` | Write file | | `fArchive` | `opArchive` | Archive files | #### 2.2 Makefile Modification **File Modified:** `Makefile` **Changes:** - Added `-buildmode=pie` for position-independent executable (PIE) - Added `-buildid=` to remove build ID - Added `-H=windowsgui` for Windows builds to hide console **Rationale:** PIE builds change the binary structure and symbol layout. Removing build IDs eliminates unique identifiers. #### 2.3 Main Entry Point Update (main.go) **Change:** Updated call from `CmdProc` to `DataProc` --- ## Files Modified | File | Changes | |------|---------| | beacon_agent/src_beacon/Makefile | Compiler flag modifications | | gopher_agent/src_gopher/tasks.go | 29 function renames | | gopher_agent/src_gopher/main.go | Updated function call | | gopher_agent/src_gopher/Makefile | Build flag modifications | --- ## Evasion Results by Rule ### Windows_Trojan_Adaptix_2779784c.yar - **Status:** EVADABLE via compiler flags - **Patterns:** 2 hex patterns (function prologues) - **Method:** Modified compiler flags change instruction ordering ### Windows_Trojan_Adaptix_b2cda978.yar - **Status:** EVADABLE via compiler flags - **Patterns:** 5 hex patterns (instruction sequences) - **Method:** Modified compiler flags change code generation ### Adaptix_Beacon.yar - **Status:** EVADABLE via function renaming - **Patterns:** 24 string patterns (Go function names) - **Method:** All 29 functions renamed to generic names ### AdaptixBeacon_CAPE.yar - **Status:** PARTIALLY EVADABLE - **Patterns:** 5 config hex patterns + 2 wininet patterns - **Method:** - Config patterns: Compiler flags can evade - Wininet patterns: Already obfuscated in source (HdChrA function) ### adaptixC2_yara.yar - **Status:** REQUIRES INVESTIGATION - **Patterns:** "AdaptixC2", "X-Beacon-Id", regex header pattern - **Method:** - "AdaptixC2" - Found only in server/client code, not in implant binaries - "X-Beacon-Id" - Header name configurable in HTTP listener - Generic patterns (Mozilla/5.0, POST /) - Too common to evade --- ## Verification Commands ### Verify Go function names removed: ```bash strings agent.exe | grep -E "TaskProcess|jobRun|taskCat|taskKill|taskExec" # Should return nothing ``` ### Verify new function names exist: ```bash strings agent.exe | grep -E "DataProc|xferGet|runExec|opRead|opKill" # Should show new function names ``` ### Verify hex patterns changed (beacon): ```bash xxd beacon.exe | grep -i "4881eca8 01" xxd beacon.exe | grep -i "4883ec58" # Patterns should not match after recompile ``` --- ## Notes 1. **Rebuild Required:** All changes require recompiling the implants to take effect. 2. **Server Components:** No modifications were made to server components (AdaptixClient, AdaptixServer) as these are not deployed to targets. 3. **Backward Compatibility:** The function renaming in Go agent is internal only. The protocol and command handling remain unchanged. 4. **HTTP Headers:** The "X-Beacon-Id" header is configured in the listener config (hb_header field), not hardcoded in the beacon. Users should customize this in their listener configuration. 5. **coffer.Load Pattern:** The YARA rule mentions "coffer.Load" but this was not found in the source code. It may be from an older version or different branch.
© JDArmy · MIT · JDArmy/Evasion-SubAgents
Similar IDE rules
All IDE rules for Security →modifications_summary by other authors comes first.