Skip to content

feat: multi-platform agents, Discord C2, services & OPSEC hardening#324

Closed
En3nr4 wants to merge 11 commits into
Adaptix-Framework:dev-v1.3from
En3nr4:upstream-contribution
Closed

feat: multi-platform agents, Discord C2, services & OPSEC hardening#324
En3nr4 wants to merge 11 commits into
Adaptix-Framework:dev-v1.3from
En3nr4:upstream-contribution

Conversation

@En3nr4
Copy link
Copy Markdown

@En3nr4 En3nr4 commented May 2, 2026

Summary

Major feature contribution adding multi-platform agent support, new C2 channels, operational services, and OPSEC improvements to AdaptixC2.

New Agents

  • Linux Agent — Native C agent (x86_64 + ARM64), no libc dependency, ELF hash-based API resolver, direct syscalls, anti-debug/VM/container detection, ELF BOF loader, 26 commands, SOCKS/port forwarding, 12 post-exploitation BOFs
  • macOS Agent — Native C agent (ARM64 Apple Silicon) with osxcross cross-compilation, dyld resolver, Mach-O + shellcode formats, 26 commands including macOS-specific (screenshot, clipboard, persistence, TCC, keychain, browser dump)

New Listeners & Connectors

  • Discord Listener + Connector — Full C2 over Discord API (webhook + bot token), with message cleanup support
  • Linux TCP Listener — Bind TCP listener for Linux agent

New Services

  • Hosting Service — HTTP file hosting service with endpoint management
  • Phishing Service — Campaign manager with email templates (6 templates), landing pages (4 landers), and credential tracking

Beacon OPSEC Enhancements

  • AES-256-GCM encryption — Upgrade from RC4 across all listeners and connectors
  • Per-payload DJB2 seed randomization — Crypto-random 32-bit seed per payload, unique API hash signatures
  • Polymorphic XOR encoder — 16-byte key shellcode encoder with PEB-walking decoder stub (x64/x86)
  • Module Stomping reflective loader — stub_rdi.x64.asm (~2150 bytes) with LoadLibraryExA DLL overwrite, SEC_COMMIT fallback, UI controls for DLL path selection
  • Keylogger — GetAsyncKeyState-based with foreground window tracking, DJB2-resolved user32 APIs

Infrastructure

  • Updated profile.yaml, go.work for new modules
  • All new extenders include config.yaml, ax_config.axs, Makefile

Test plan

  • Build: make server-ext compiles all 13 extenders + server cleanly
  • Beacon: generate HTTP/TCP/SMB/DNS/Discord × shellcode/DLL/service × x64/x86
  • Linux agent: generate ELF x86_64 + ARM64, verify check-in over TCP
  • macOS agent: generate Mach-O + shellcode ARM64, verify check-in over TCP
  • Discord: create listener, generate Discord beacon, verify check-in
  • Hosting service: create hosted file, verify download via HTTP
  • Phishing service: create campaign, verify landing page + credential capture
  • Verify existing beacon/gopher agents unaffected (non-regression)

En3nr4 added 11 commits May 2, 2026 13:28
Replace weak RC4 stream cipher with AES-256-GCM authenticated encryption
across the entire beacon/listener stack:

- Beacon C++: new Crypt.cpp with AES-256-GCM (encrypt returns [IV][CT][Tag],
  decrypt with authentication) + AES-256-CTR stream for DNS label data
- All connectors updated (HTTP, SMB, TCP, DNS)
- Agent/AgentConfig: 32-byte session keys, AES-GCM encrypted beats
- Go plugins: AES256GCMEncrypt/Decrypt replacing RC4Crypt
- All 4 listeners updated (HTTP, TCP, SMB, DNS)
- DNS listener: AES-CTR stream for control data, AES-GCM for session data
- Key size: 16 bytes (128-bit RC4) → 32 bytes (256-bit AES)
- UI configs: encrypt_key field updated to 64 hex chars
Native C agent for macOS ARM64 (Apple Silicon M1/M2/M3/M4):
- Cross-compiled from Linux via osxcross (aarch64-apple-darwin23.5-clang)
- Formats: Mach-O binary, Shellcode ARM64 (XOR-encoded dylib), Go fallback
- 26 commands: fs ops, process mgmt, shell, screenshot, clipboard,
  persistence, TCC check, EDR detection, keychain, browser dump,
  download, upload, run, tunnels, terminal, SOCKS proxy
- AES-128-GCM crypto, msgpack wire protocol, TCP connector
- ~100 KB Mach-O, ~120 KB shellcode blob
- Polymorphic ARM64 XOR decoder stub
Discord-based C2 channel using Discord bot API for beacon communication.
Provides covert communication over legitimate Discord infrastructure.
ConnectorDiscord.cpp/h: Discord bot API-based C2 connector for the beacon,
enabling communication through Discord channels as a covert transport.
Web hosting service for serving payloads, files, and static content
through the Adaptix teamserver infrastructure.
Phishing campaign management service with email templates, landing pages,
campaign tracking, and click/submit analytics.
Keylogger.cpp/h: Windows keylogging capability using low-level keyboard
hooks (SetWindowsHookExA). Captures keystrokes with window context and
reports via async job output.
- Per-payload DJB2 seed randomization: each generated payload gets a
  unique crypto-random seed, generating unique API hash constants
  (ApiDefines.h) and recompiling all hash-dependent source files
- Module Stomping reflective loader (stub_rdi.x64.asm): replaces the
  pre-compiled sRDI stub with a full NASM source assembled per-payload
  with seed-derived hash defines and MODULE_STOMP enabled
- Polymorphic XOR encoder: wraps shellcode payloads with a randomized
  decoder stub featuring junk instructions and register randomization
- Build pipeline ships beacon source files for per-payload recompilation
- Add Obfuscate.h: compile-time XOR string encryption header
- Add DebugLog.h: debug logging stub (no-op in release builds)
- Add ProfileDiscord struct and BEACON_DISCORD config to AgentConfig.h
- Add user32.dll API hashes to ApiDefines.h (keylogger resolution)
- Add GenerateRandomBytes() utility function
- Add DJB2_SEED default to pre-compilation Makefile flags
- Exclude ConnectorDiscord.o from non-Discord object directories
…ility

- Add new extenders to profile.yaml and go.work for proper loading
- Fix Teamserver interface in linux/macOS agents (TsDownloadAdd int64,
  add Terminal/TunnelPause methods)
- Wire Discord connector build pipeline (Makefile, config.yaml, ax_config)
- Add module stomping UI controls and stomp_paths.inc generation
- Add keylogger command dispatch in Commander
- Fix 8 missing DJB2 hash constants in pl_hashes.go
- Regenerate go.sum for all new modules
@En3nr4 En3nr4 changed the base branch from main to dev-v1.3 May 2, 2026 11:37
@RalfHacker
Copy link
Copy Markdown
Contributor

Split this large PR into several smaller PRs. A single PR should not contain fixes for several different components.

@En3nr4
Copy link
Copy Markdown
Author

En3nr4 commented May 23, 2026

Closing this PR and splitting into smaller, component-focused PRs as requested:

  1. feat: upgrade beacon encryption to AES-256-GCM + OPSEC hardening #330 — Beacon: AES-256-GCM encryption upgrade + OPSEC hardening (polymorphism, module stomping, keylogger, Discord connector)
  2. feat: add Discord beacon listener #331 — Discord beacon listener
  3. feat: add native Linux agent (x86_64 + ARM64) with TCP listener #332 — Native Linux agent (x86_64 + ARM64) + TCP listener
  4. feat: add native macOS agent (ARM64 Apple Silicon) #333 — Native macOS agent (ARM64 Apple Silicon)
  5. feat: add hosting service extender #334 — Hosting service extender
  6. feat: add phishing service extender #335 — Phishing service extender

Each PR targets a single component and can be reviewed/merged independently.

@En3nr4 En3nr4 closed this May 23, 2026
@En3nr4
Copy link
Copy Markdown
Author

En3nr4 commented May 23, 2026

Split this large PR into several smaller PRs. A single PR should not contain fixes for several different components.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants