modifications_summary · jdarmy, adaptixc2 — правило для Claude Code
Правило modifications_summary для Claude Code хранит в контексте отчёт о правках AdaptixC2 под YARA: флаги сборки beacon, переименования функций Go-агента и команды проверки. Напоминает, что изменено в репозитории.
MIT ★ 336 обновлён 2026-04-09
.claude/rules/modifications_summary.mdЧто делает modifications_summary
Правило modifications_summary — markdown-файл, который Claude держит в контексте, пока вы работаете с репозиторием. Внутри отчёт от 2026-03-18 о правках AdaptixC2: таблица разобранных YARA-правил от Elastic Security, bartblaze, enzok/CAPE и nembo81, список изменений в C++ beacon и Go-агенте, команды проверки через strings и xxd.
В beacon_agent/src_beacon/Makefile добавлены флаги -fno-inline-functions-small, -fno-expensive-optimizations, -fno-tree-loop-vectorize и другие, а -fno-unwind-tables перенесён в EVASION_FLAGS. В gopher_agent/src_gopher/tasks.go переименованы 29 функций (CmdProc → DataProc, fRead → opRead), в сборку Go-агента добавлены -buildmode=pie, -buildid= и -H=windowsgui, вызов в main.go обновлён.
Само правило ничего не патчит. Флаги и новые имена попадут в бинарник только после пересборки имплантов, поэтому файл работает как память о том, что уже сделано. Заголовок X-Beacon-Id живёт в конфиге листенера, в поле hb_header, и в бинарник не зашит.
Какие задачи решает
- найти, какие флаги уже добавлены в
Makefilebeacon-агента - сопоставить старое и новое имя функции Go-агента при чтении кода
- понять, какие YARA-правила остались обходимыми частично
- восстановить контекст правок перед пересборкой имплантов
- отделить изменения имплантов от нетронутых серверных компонентов
Примеры запросов агенту
- Покажи, какие флаги добавлены в
beacon_agent/src_beacon/Makefileи что каждый из них меняет в сборке. - Какие функции в
gopher_agent/src_gopher/tasks.goпереименованы и как теперь называетсяfRead? - Какие YARA-правила остались частично обходимыми и что мешает закрыть остальное?
Как установить modifications_summary
Вручную: положить файлы
.claude/rules/modifications_summary.mdПоле paths во frontmatter ограничивает файлы
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.cursor/rules/modifications_summary.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.github/instructions/modifications_summary.instructions.mdПоле applyTo задаёт, к каким файлам применять
Вручную: положить файлы
.devin/rules/modifications_summary.mdВручную: положить файлы
.clinerules/modifications_summary.mdПо шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать
Вопросы о modifications_summary
Как установить modifications_summary в Claude Code?
Скопируйте файл в проект по пути .claude/rules/modifications_summary.md.
Что описывает modifications_summary?
Правки AdaptixC2 от 2026-03-18: флаги компилятора для C++ beacon, переименование 29 функций и новые ключи сборки Go-агента, разбор YARA-правил и команды проверки.
Влияет ли переименование функций на протокол Go-агента?
Нет. Имена внутренние, обработка команд и протокол не менялись, вызов в main.go просто перевели на DataProc.
Исходный текст
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
Похожие правила IDE
Все правила IDE по теме «Безопасность» →Сначала — modifications_summary от других авторов.