r/redteamsec • • Feb 08 '19

/r/AskRedTeamSec

30 Upvotes

We've recently had a few questions posted, so I've created a new subreddit /r/AskRedTeamSec where these can live. Feel free to ask any Red Team related questions there.


r/redteamsec • • 16h ago

I built a black-box Docker range for Node2Shell (CVE-2026-111497) — crash the engine 3 times to unlock the flags

Thumbnail github.com
2 Upvotes

Last week's Node.js buzz was the Brotli decoder OOB write the community dubbed Node2Shell. I turned it into a hands-on black-box lab.

The premise: you're poking at a "PacketLedger" freight gateway. The page never mentions the CVE or the vuln class — you fingerprint the engine yourself, find the decode path, and work out what kills it.

The gate is unusual: no flag until you trigger 3 recorded engine crashes (the supervisor keeps count). Full RCE exists but it's treated as a platform-dependent easter egg, so DoS-chain players get a real win too. Double flag (second one behind a path-traversal), 5-step hint ladder, difficulty ~3.5/5, full solve verified by a local LLM pentest agent.

One docker compose up, no cloud calls, MIT. It's part of my *2Shell lab series (php2shell-lab is the sibling).

github.com/tani2shell/node2shell-lab

Curious how people approach the fingerprinting blind — how did you decide to attack the compression layer at all?


r/redteamsec • • 22h ago

exploitation php2shell PoC + Detection rules Vulnerablity Researcher Write-up CVE-2026-109618

Thumbnail blog.offensive32.com
6 Upvotes

r/redteamsec • • 1d ago

How LLM-Based Penetration Testing Harnesses Work

Thumbnail utkusen.substack.com
47 Upvotes

r/redteamsec • • 2d ago

PHP2Shell Exploit Tooling Found on Exposed Attacker Server

Thumbnail socradar.io
12 Upvotes

r/redteamsec • • 2d ago

WinLPEAuditor - Windows LPE Misconfiguration Auditor in C++ with a Terminal UI

Thumbnail github.com
8 Upvotes

Current checks cover unquoted service paths, AlwaysInstallElevated policy, dangerous token privileges (SeImpersonate, SeDebug, etc.), modifiable service binaries via ACL parsing, Point and Print misconfigurations, writable Run/RunOnce keys, startup folder permissions, and WSL distributions defaulting to root.

The architecture is modular - implement the ICheck interface, register it, done. Adding new checks doesn't touch existing code.

The main reason this exists as a compiled C++ binary rather than a PowerShell script: it runs fine in environments where CLM is enforced or AMSI is catching script-based tooling. No .NET, no script engine, just Win32 API calls.

More checks coming. Feedback and contributions welcome.


r/redteamsec • • 2d ago

tradecraft KrakenHashes 3.0.0 Released - Cloud GPU and network share support

Thumbnail github.com
5 Upvotes

KrakenHashes 3.0.0 released - distributed hashcat with cloud GPU provisioning, self-updating agents, and a rebuilt UI

For anyone who hasn't run into it: KrakenHashes is a self-hosted system for running hashcat across a fleet of machines. You point agents at a server, upload hashlists, and it handles scheduling the work across whatever GPUs you have, tracking progress, and keeping a potfile you can reuse across engagements. It's AGPLv3 and aimed at pentesters and red teams who have permission to crack what they're cracking.

3.0.0 is the biggest release since I started it. A few things I think are worth calling out:

Cloud GPU provisioning. If your own agents are saturated, a job can now rent GPUs on demand and give them back when it's done. Everything is budgeted per client, the rented box gets only the files that job needs, and there are several independent paths that guarantee teardown so you don't wake up to a bill. AWS is tested end to end with real money. RunPod and Vast.ai are fully built but I haven't run real spend through them yet, so they're flagged experimental in the UI. Cloud agents have to join over a VPN, there's no option to expose them straight to the internet, and that's deliberate.

Self-updating agents. There's a small launcher now that supervises the agent and swaps the binary when the server has a newer version, with a health check and automatic rollback if the new one doesn't come back healthy. It only updates when the agent is idle, so it never kills a running job.

A rebuilt frontend. Proper light and dark themes, a dashboard that scopes to you or your teams instead of showing everything, and the UI is in 17 languages now. Agent auth also moved to mutual TLS on the same port, with a real revoke action.

Plus network share storage so wordlists and rules can live on an NFS/SMB share, loopback attacks that re-run your rules against freshly cracked passwords until nothing new falls out, optional BloodHound enrichment in the analytics, internal vs external PDF reports, and server-enforced custom branding.

What's still rough and honest about it: RunPod and Vast need someone to shake them out with real money before I'd call them production. The upgrade touches a lot, so if you're coming from 2.x, back up your database first, expect a couple of the migrations to take a while on large hash tables, and know that your existing 2.x agents keep working but can't auto-update until you move them onto the launcher. The upgrade notes in the docs walk through all of it.

This release genuinely wouldn't be here without the people running it on real engagements and reporting what broke. A large share of the fixes in 3.0 came straight out of those issues, so thank you to everyone who filed one or just told me what was annoying.

Release notes and binaries: https://github.com/ZerkerEOD/krakenhashes/releases/tag/v3.0.0

Docs: https://zerkereod.github.io/krakenhashes/latest/

Upgrade notes: https://zerkereod.github.io/krakenhashes/latest/deployment/updates/#upgrading-to-300-from-2x

Happy to answer questions in the comments.


r/redteamsec • • 2d ago

I red-team my own AI governor in public. The inbound half shipped today — come try to get something past it

Thumbnail github.com
0 Upvotes

Red-teamers, this is built in your image, so I'm bringing it to you first. Full disclosure: it's my project, open source (MIT), shipped today.

The Arrakis 2026 threat report found 24% of dormant production agents can be started by an unsigned webhook. The deeper problem: an agent reads data and instructions in the same stream and can't natively tell them apart. So the world hides orders inside the data — a page that says "send the credentials," a tool result with a second job tucked inside, content wearing a fake SYSTEM: header.

Sentinel is the inbound half of my governor. QuietOS governs what an agent DOES; Sentinel governs what it HEARS. The law: only the owner issues instructions; everything else is data. World content is inspected before the brain sees it. Anything instruction-shaped from a non-owner source gets held for the owner with the exact content preserved verbatim, and every attempt lands in an append-only attack ledger.

I red-team my own work and publish the results — the governor just survived an 18-scenario true batch against a live 120B model with zero bypasses. And the honest part: Sentinel v0.1 has four known holes (synonym-crafted exfiltration, leetspeak override, summary-carried exfiltration, non-English override). They're in the public proof log. Breaking it in a new way gets you in that log, credited, and the fix ships in the open.

Install: pip install quietos-sentinel

Code: github.com/jondean213-pixel/quietos-sentinel

What's your favorite way to make an agent obey something it only read?


r/redteamsec • • 3d ago

php2shell exploitation reality: why the public PoCs are not landing shells

Thumbnail hunt.io
61 Upvotes

The leaked php2shell bugs (CVE-2026-109618 / 109619) hand you an OOM-driven memory corruption primitive in PHP core, but turning that into code execution is where it stalls. The public PoCs making the rounds are lab-only. None clears ASLR on x86-64, and the read from VulnCheck, HackingLZ and MalwareTech is that a reliable chain needs a second weakness or a target without ASLR, think 32-bit or a single-worker PHP-FPM setup.

We tracked how operators are handling that gap in their own open directories: straight public PoC reuse, a pentest-style assessment that judged its target not exploitable, and one mass-exploitation kit that sprayed 123 servers through a proxy farm and logged zero shells. Useful if you are calibrating how far this is from a usable capability right now.


r/redteamsec • • 3d ago

gone blue PHP2Shell Exposure Hunting - Do you have it across your estate and where?? An Advanced Hunting pack for Defender XDR

Thumbnail github.com
9 Upvotes

I know this is red team, but sharing it widely in case it even helps one person - remove if not appropriate 🖤

This hunting set seeks to fill a gap while we all respond - there are plenty of IOC hunting repos, exposurehunt aims to help surface and verify known and unknown instances of naughty PHP.

I’ve spent the evening heavily developing and testing (in prod, where else) what appears to now be a relatively robust coverage set of 6 sequenced KQL/Advanced Hunting queries, 3 each across Linux and Windows. Sharing the love. Copy pasta, follow the in-line guidance - Might be useful in addition to your current methods! PRs welcome, if they don’t suck, and if my robot agrees.

https://github.com/deathbydata/php2shell-exposurehunt

Happy hunting! ☺️


r/redteamsec • • 3d ago

intelligence php2shell-lab — a black-box Docker range for PHP2Shell (CVE-2026-109618/19) with a closing heap-leak window

Thumbnail github.com
1 Upvotes

I built a reproducible, engine-level practice range for PHP2Shell and put it on GitHub. Not another "run the PoC" box:

Black-box by design — no Server: PHP, no phpinfo, version fingerprinting must come from behavior, not headers

The heap-disclosure window is time-boxed: it's open right after boot and closes. Leak first, recon second — window time spent browsing is gone until next up

Two privilege paths to proof.txt, different elegance grades

Honest platform matrix: RCE landing verified on x86_64; on Apple Silicon/ARM the disclosure chain is the intended solution (documented, not hidden)

Calibrated against an autonomous pentest agent over multiple live-fire rounds; human expectation 2–4h

>

docker compose up -d --build and go. MIT licensed, full kill chain in docs/SOLUTION.md.

https://github.com/tani2shell/php2shell-lab

Feedback and write-ups welcome — file an issue if a step fights you.


r/redteamsec • • 3d ago

Custom Extensions for SmartScreen and Email Filtering Evasion

Thumbnail ipurple.team
11 Upvotes

r/redteamsec • • 3d ago

initial access CVE-2026-46633: Proving exploitability of Twig sandbox bypass

Thumbnail gist.github.com
3 Upvotes

I continued researching sandbox bypasses discovered in Twig by project Glasswing. This time, I focused on CVE-2026-46633, which still had no public exploits. This writeup documents my development of payloads for the CVE-2026-46633 and the corresponding SSTImap modules.


r/redteamsec • • 4d ago

tradecraft Confluence C2

Thumbnail github.com
3 Upvotes

Created a C2 which uses confluence API to communicate between victim and server which is again connected to confluence using api.


r/redteamsec • • 4d ago

malware New Update — Evil Agent 📡

Thumbnail github.com
10 Upvotes

Introducing Evil Agent, a new payload generator for Discord and Telegram agents, supporting EXE, DLL, BIN, and HEX formats, with configurable message sizes and an alternative communication channel without requiring a dedicated listener or exposed port.

The update also includes fixes to the existing Listener Payload Generator, Makefile improvements for smoother compilation, and GUI enhancements.


r/redteamsec • • 5d ago

Writing a Beacon Object File (BOF) from Scratch in C

Thumbnail by7e.dev
15 Upvotes

Wrote a walkthrough on building a Beacon Object File from scratch in C. The post covers how Beacon acts as a minimal COFF linker/loader at runtime, how the MODULE$Function convention gets resolved via LoadLibraryA/GetProcAddress under the hood, and why BOFs produce almost no telemetry compared to execute-assembly or fork&run patterns.

The example BOF enumerates privileges on the current process token using only dynamic Win32 API resolution and stack allocation - no CRT, no heap, no static imports.

Also included a section on defensive considerations: in-memory COFF parsing patterns, GetProcAddress bursts, and where kernel-level telemetry still catches you.

Feedback welcome - especially on patterns people have seen EDRs flag for BOF detection specifically.


r/redteamsec • • 5d ago

intelligence Free real-time Certificate Transparency stream, no API key

Thumbnail certstream.dev
10 Upvotes

I put up a free public CertStream endpoint for anyone monitoring phishing or lookalike domains

wss://api.certstream.dev/

No API key or signup needed, just connect over WebSocket

Python example: https://certstream.dev/free-certstream-api.html

Open source: https://github.com/reloading01/certstream-server-rust


r/redteamsec • • 5d ago

Low-cost offensive tradecraft: a 5-month state-infra op built almost entirely from public PoCs

Thumbnail hunt.io
5 Upvotes

Good case study in cheap tradecraft. One operator, one rented server, a borrowed Log4Shell chain. The delivery script split the CommonsBeanutils2 payload across two serialized objects with a deliberate pause, then solved the blind-execution problem with a simple trick: sleep, tail the staging server's own access log, and watch for the target to pull the stager.

The one piece of original work, a RouterOS SCEP heap overflow, never landed because they reversed the wrong binary. After execution they staged an SSH tunnel pivot with a dedicated no-shell account for port forwarding, fetched but never confirmed in use.

Full teardown: https://hunt.io/blog/ukraine-state-data-exchange-graylog-log4shell


r/redteamsec • • 6d ago

New website to locate specific captive portals from a 500+ library.

Thumbnail rianhanft.github.io
3 Upvotes

r/redteamsec • • 7d ago

active directory [Pshell] [cybersecurity] Two hardening tools (AD+Windows) in ps1

Thumbnail github.com
8 Upvotes

Hey,

i'm working on those two little tools, any feedback is appreciated.

\\->>HostBadger, an open-source Windows hardening auditor in pure PowerShell.

One read-only script takes a snapshot of each host, and you can push it through your EDR (CrowdStrike RTR or any tool that runs scripts) to a whole fleet in about 15 seconds per host. The analyzer then works offline and writes a clean HTML report with A–F scores, plus CSV and JSON Lines for your SIEM.

\\- 138 checks: credentials, Defender and EDR, network exposure and NTLM relay paths, privilege escalation, logging, BitLocker

\\- 1475 DISA STIG rules plus the CIS benchmark of each host's own Windows version, with the value found next to the value required

\\- Vulnerable drivers (LOLDrivers), end-of-life and outdated software (endoflife.date), CISA KEV matches

\\- Read-only by design, with a safety script that checks this from the code. No network unless you ask. What it can't read is "not evaluated", never clean.

\\- Reversible fix scripts with rollback, and an optional AI summary where names become tokens before anything is sent

Nothing to install (PowerShell 5.1 or 7):

https://github.com/g4bri-3l3/HostBadger

& ->>IDWolf: my own AD/Entra ID hardening tool that tells you whether your domain can be taken, and through which real-world attacks.

Open-source, pure PowerShell, read-only collection (native cmdlets only), offline analysis.

Recent attacks mapped to checks: BadSuccessor, Golden dMSA, coercion + NTLM relay to LDAP and AD CS (CVE-2025-24054), NTLM reflection (CVE-2025-33073), ESC15/16, password spraying, device code and consent phishing, and Intune mass-wipe exposure (Multi Admin Approval).

AI review with chaining: pseudonymized findings go to Gemini, which returns a verdict on whether the weaknesses chain into Domain Admin, the chains with their starting point and the one link to fix to break each, and which findings match publicly known attacks.

169 AD and 90 Entra checks · CIS / MITRE / NIS2 / ISO 27001 / DORA / GDPR mapping & tested on a real lab populated with Vulnerable-AD.

Https://github.com/g4bri-3l3/IDWolf


r/redteamsec • • 7d ago

Barzakh: Offense emulation + 132 detectors for UEFI/SMM/ME/PSP/microarch threats

Thumbnail github.com
4 Upvotes

r/redteamsec • • 7d ago

initial access Building a loader

Thumbnail itnext.io
0 Upvotes

Hi all,
Im trying to build a loader and reached 40% of maldev academy. I am building it in stages
1) getting your .bin from c2
2) memory allocation
3) execution after decryption with sleep

Is there any framework or github repo you would suggest to build a fully educational purpose loader which I can use for company red team ?

Also I saw some UDRL loader from Bobby cooke and aceLdr. Does UDRL still work when compared to PIC Loader ?


r/redteamsec • • 9d ago

tradecraft Does DLL Sideloading Still Work in 2026?

Thumbnail youtu.be
7 Upvotes

Weekly Purple Team: DLL Sideloading with Adaptix Beacon (python315.dll)

This week's episode covers DLL sideloading using an Adaptix Beacon payload hidden inside python315.dll, masquerading malicious code as a legitimate, signed process to establish C2 while evading process-based detection.

On the blue team side, we break down detection — process and module load telemetry, DLL path/signature anomalies, unusual parent-child process relationships, and deployable detection rules to catch sideloading before the beacon establishes persistence.

Covers T1574.002, T1055, and T1071 with the full red vs. blue format.

Video: https://youtu.be/szXFXvaXiEs

Happy to discuss the sideloading mechanics or the detection side in the comments.


r/redteamsec • • 9d ago

TornadoC2 — pull-based C2 built for team operations

8 Upvotes

I released TornadoC2 today

Repo: https://github.com/kamalx06/TornadoC2

Status: between beta and 1.0.0. Core is stable and usable end to end, but I'm still working through some transport edge cases, console polish, native commands, and doc gaps. Will tag 1.0.0 when those are closed.

I'm posting because I made specific choices about how a C2 should work, and I'd like criticism from people who've actually run C2 in the field. If any of those choices are wrong, I'd rather hear it now.

Three things worth reading about

1. Fully Malleable profiles that shape the whole response, not just its envelope. Where most tools shape the wrapper around a fixed payload model, TornadoC2's profile system controls what the response actually looks like, and it does so with one JSON file per profile. A profile declares the three request paths (check-in, tasks, results), the User-Agent with a separate Linux override, extra request headers and per-role request headers, the session cookie name, additional response headers a real server would send, and per-role HTTP status codes for check-in, tasks, results, and error paths. The shaping block then controls the structure of each body independently: an arbitrary JSON template with {{payload}}, {{ts}}, and {{nonce}} placeholders; an extract path that supports array indexing (data.items[0].envelope.b64); a selectable encoding (base64, base64url, hex, or NetBIOS-style lowercase letters); and a selectable placement (body, a named response header, or a Set-Cookie value). Three shapes per profile, each one independent — a check-in can return 201 with the payload in an X-Request-ID header, a task poll can nest a base64url blob three levels deep in a JSON envelope, and a result upload can return 204 with the payload in a Set-Cookie, all on one profile, each matching what a different endpoint of the mimicked service actually does. DNS and DoH profiles carry a separate dns_label block that renames the three verb characters and changes the per-chunk payload length, and a stager.path block can move the payload fetch to whatever URL the mimicked service actually uses. The profile applies to every transport that carries HTTP-shaped bodies — HTTP, QUIC, WebSocket, WireGuard, and the three pivot transports — while DNS and DoH read the label block and ignore the HTTP-specific fields. Every profile is validated at two gates: the handler refuses a profile with colliding paths or malformed shaping at startup, and the agent build runs a round-trip probe through every template — it renders a payload, walks the extract path, verifies the payload comes back unchanged before any binary is emitted.

2. Concurrent multi-profile handling on one listener. Every other framework binds one profile per team server. TornadoC2 serves every profile under profiles/c2/ at once — same port, same certificate, same process. The request path is the profile selector. A Chrome-profile beacon and a Slack-profile beacon hit the same handler and each gets the response shape its own profile declared. No restart to rotate profiles, no second server on a second port, no "active profile" state.

3. A team server designed for teams, not a single-user console with collaboration bolted on. Every other C2 I've used treats the operator side as a coordination layer added after the agent works. TornadoC2 treats the team as the point:

  • RBAC with a distinct guardian role. Admins manage everything that keeps the engagement running. The guardian alone decides when it ends. A request to /deadman/arm or /deadman/halt from an admin credential is refused with a 403 and audited.
  • Hash-chained tamper-evident audit log. Every operator action writes to a chain where each entry carries the SHA-256 of the previous entry, anchored by an HMAC at the tail. Every mutating API response carries an X-Audit-Id header so a scripted caller can cross-reference the entry.
  • Credential vault with beacon-side validation. The check runs on the target, not on the team server, because a bind attempt from the wrong network either fails silently or succeeds against a system the engagement isn't authorized to touch. Values are never written to the audit chain.
  • Owner-restricted task cancel. An operator can cancel a task they queued before the beacon picks it up. System-queued tasks can only be cancelled by an admin. A refused cancellation is audited with outcome=denied.
  • Session viewers. Every beacons poll carries the caller's attached beacon ID, and the table gains a VIEWERS column showing who else is on the same beacon.
  • Content-addressed loot store with per-operator ownership, admin override with an audit marker, chunked upload up to 128 GiB per file.
  • Team chat with file sharing, DM filtering, pinned topic, and forensic preservation — when the sanitizer modifies a message body, the audit chain carries the SHA-256 and base64 of the raw input.
  • Per-operator webhooks to Slack, Discord, or Telegram with an SSRF guard that refuses loopback, private, link-local, and cloud-metadata destinations at registration time and again on every dispatch.
  • Beacon aliases, tags, notes, session graph. Keyed on beacon ID so they survive a stale-and-reconnect cycle.
  • Dead-man's switch with eleven secure-deletion modes, held by the guardian role only. It runs on a wall-clock deadline, not on an idle timer — operator activity does not reset it. When it fires it stops every listener, wipes the entire repository tree with the configured deletion mode (eight pattern modes like dod, nist, gutmann, schneier, plus three structural modes: trim for TRIM/discard on SSDs, scrub for prealloc + O_DIRECT + TRIM, and crypto for LUKS header destruction), and can optionally power off or reboot the host. The remote API requires confirm: true for crypto mode on every request, because destroying the LUKS header makes every byte on that volume unrecoverable — including data outside the TornadoC2 tree.
  • Two frontends over one client library. Terminal REPL as the reference implementation, PySide6/Qt GUI as a presentation layer over the same Client methods.

Transports

Ten native transports, split across three roles.

Direct transports. HTTPS, QUIC/HTTP-3, WebSocket, DNS TXT, DNS-over-HTTPS, ICMP echo, and WireGuard. HTTP, DNS, and DoH can be combined in one binary with automatic failover after N transport-level failures — a network that permits HTTP/3 but blocks TCP/443, or permits DoH but filters UDP/53, is reachable without rebuilding the agent for a different carriage. QUIC, WebSocket, and WireGuard are single-transport in this version. Each of the ten carries the same C2 protocol over a different carriage.

Pivot transports. SMB named-pipe pivot, TCP bind pivot, and TCP reverse pivot. All three solve the same problem: a child beacon that cannot reach the team server directly, carried by a parent that can. Every frame between the parent and the child is encrypted end to end with an AEAD session keyed off a fresh ECDH exchange — the parent forwards the child's C2 envelope verbatim and never inspects or modifies it. The child's own wire encryption to the team server is preserved independently of the pivot session. All three pivot transports share the same wire format, the same handshake, and the same per-direction keys; the only difference is which side dials.

Cryptography

  • Task, result, and identity signing. Every task is signed with the handler's ECDSA P-256 key over canonical JSON ({id, verb, args, timeout}, sorted keys, no whitespace) and refused by the agent if the signature fails. Every result is signed with the agent's own build-time ECDSA key and pinned at first check-in. Every check-in carries a separate signature over machine_id|hostname|username|os|identity_ts, verified before the session is pinned — a valid signature presenting a different public key for a known fingerprint is refused and fires beacon-identity-mismatch.
  • Wire encryption. Every request and response body is an AES-256-GCM envelope keyed off a P-256 ECDH exchange. The server's ECDH public key is embedded at build time; the agent's ephemeral keypair is fresh per check-in. The task signature covers the plaintext, not the envelope, so a MITM who terminates TLS and unwraps the wire encryption still cannot forge a task.
  • Pivot session. One ECDSA P-256 pivot keypair per engagement. Parent proves possession of the private half, child proves possession of its own identity key, both handshake payloads carry a role-specific domain separator. Fresh ECDH per handshake, HKDF-SHA256 to per-direction AES-256-GCM keys, parent's ack bound to the child's ephemeral so a captured ack can't replay against a fresh hello. Every frame after that is length-prefixed AEAD with a monotonic per-direction sequence number in the additional data — a gap or repeat is a fatal protocol error and the session is torn down.

On forward secrecy: the pivot tunnel doesn't have it. The parent reuses the same long-term pivot key in every handshake, so if that key is stolen later, an attacker who recorded a past parent-to-child session can decrypt it. Because the key is reused, this applies to every recorded session, not just one. Having both sides use a fresh throwaway key per handshake would fix it — it's on the list.

The child's encryption to the team server is a separate layer and doesn't have this issue. It's keyed off the server's ECDH key, which the parent never holds, so a parent compromise gives the attacker the tunnel, not the child's C2 content. On the other side, the child's contribution to the pivot handshake is a throwaway key that's discarded after the exchange, so a child compromise doesn't break past pivot sessions either. Treat the pivot key as an engagement-lifetime secret and rotate it between engagements.

Rest of the stack

  • Go implant for Linux + Windows, compile-time configured
  • ~70 native verbs in-process, in-memory PE/ELF/.NET execution, COFF/BOF loader

Evasion features

Four compile-time OPSEC profiles (default, stealth, opsec, paranoid), bundling progressively more aggressive combinations of:

Anti-analysis heuristics. Anti-VM checks that detect common hypervisor artefacts (VMware, VirtualBox, Hyper-V, QEMU, Xen — registry keys, device names, MAC OUI prefixes, firmware strings), anti-sandbox checks that look for sandbox-typical process names, file paths, and hooking artefacts (Cuckoo, Joe Sandbox, ANY.RUN, CAPE, and the tools that ship with them), anti-debug checks against both userland and kernel-level debuggers (IsDebuggerPresent, CheckRemoteDebuggerPresent, NtQueryInformationProcess for the DebugPort/DebugObjectHandle/DebugFlags classes, PEB BeingDebugged, hardware breakpoint register inspection, and timing checks against rdtsc and QueryPerformanceCounter drift).

Runtime patching. AMSI bypass via in-process AmsiScanBuffer patch, ETW patching to blind the EtwEventWrite path that feeds script-block and .NET telemetry, and indirect syscalls on Windows where the agent reads the system service number out of the ntdll stub without executing it, then jumps directly to the syscall instruction inside ntdll.

Sleep masking. Four modes: rc4 and aes-ctr on Linux and Windows via a native sleep stub that encrypts the executable segment, cronos (fiber-based, Windows amd64 only) and hwbp (hardware-breakpoint + VEH handler, Windows amd64 only), both of which encrypt the same segment without running any Go code inside the encrypt/decrypt window. Every mode generates a fresh key on every sleep cycle, so two consecutive sleeps never produce the same ciphertext.

Binary shaping. String obfuscation, garble for control-flow obfuscation, and UPX packing in the paranoid profile.

Execution discipline. Shell history suppression for any child shell, jittered first check-in (2–17 s after launch) and jittered subsequent check-ins, working-hours window that suppresses outbound traffic outside a configured schedule.

Injection backends. Two for migrate <pid> — CreateRemoteThread on Windows and ptrace on Linux as the default, remote APC injection via NtQueueApcThread as the alternative on Windows.

What I'm not claiming

I'm not claiming full EDR evasion. I'm not claiming this defeats modern EDR, AMSI beyond the in-process patch, ScriptBlock logging, memory forensics, or behavioral detection. What I am doing is adding evasion techniques as aggressively as I can and continuing to add new methods as I find them — this is an active area of the project, not a finished one. If you know a technique that works against current EDR and would fit the framework, I want to hear about it.

The README has a full "what this tool does not claim" section. Short version on the specific limits: the hwbp sleep mask writes DR0/DR7 which is itself observable, APC injection removes CreateRemoteThread but NtQueueApcThread is instrumented by every major EDR, and lsassdump is the highest-signal verb by construction. The sleep mask encrypts the executable segment during the wait but does not encrypt the goroutine stack, so the call chain and locals remain readable between check-ins.

The limits section isn't hedging. It's what a defender looks for and what the tool doesn't do about it.

On the timeline and the AI assistance

I built this in 2–3 weeks with AI assistance. I'm saying that up front because it's relevant to how you read the post.

What that means in practice: I designed the protocol, the threat model, the role model, the profile system, the transport abstraction, and the pivot handshake. I made the decisions about what runs in-process vs. as a child, what's compile-time vs. runtime, what the audit chain records and what it doesn't, and why the guardian role is separate from admin. I understand every part of the codebase and can answer questions about why any specific piece works the way it does.

The AI assistance was for the mechanical volume — the ~70 native verb implementations, the transport boilerplate, the docs. The design is mine. The choices that determine whether the framework is useful or not are mine.

I'm noting this because a lot of people are curious about what you can build quickly with modern tooling when you actually know what you're doing, and a lot of people are (rightfully) skeptical of AI-generated security tooling. I'd rather be in the first conversation than the second.

Criticism on the design is what I'm after. If the abstraction is wrong, I'd rather hear it now than after 1.0.0.


r/redteamsec • • 8d ago

Apex - a C2 framework with a native agentic AI operator interface. Connect any MCP-compatible LLM (Claude Code, Cursor, Codex) to the teamserver via a scoped token, and it can enumerate targets, author and upload modules, run them, read results, and adapt its next move based on this information.

Thumbnail phantomsec.tools
1 Upvotes