During red team operations, the days of getting past security solutions using Cobalt Strike and nothing else are over. In order to get past real-time monitoring, one needs to design a C2 framework that's not only polymorphic but also, critically, nondeterministic. Legacy polymorphism like that of Sliver may get you past traditional AV solutions, but the only way to get past modern EDRs like CrowdStrike Falcon or Palo Alto XDR on a consistent basis is to get creative, especially with the implementation of AI by the EDR solutions themselves.
While going through the COAE course, the combination of tensor steganography in the AI Data Attacks module and MCP in the Attacking AI: Application and System module gave me an idea: What if it's possible to use MCP as a C2 connection, LLMs as the implants, and tensor steganography as a C2 stager? The implications of this are profound, since the end result is something that is both polymorphic AND non-deterministic from the get-go.
TensorBuster is the result of this experiment. It's an atttempt to build a complete C2 framework specifically for the age of AI, where tensor steganography is used to hide one LLM inside another and/or to hide an LLM inside image tensors, using a base model (htb-ac-1424625/Qwen3.8-2B-Distill-heretic) that began with a distillation of Qwen 3.8 parameters onto a smaller Qwen 3.5 model by the Empero team and was subsequently "abliterated" using the Heretic tool. The result is, at least in theory, a C2 framework whose implants can be controlled using plain English and can express complete and total polymorphism to avoid detection.
This tool is intended solely for use ONLY in the following contexts:
- During an authorized red team operation
- During an authorized internal penetration test of a production network
- In a bug bounty program where aggressive WAFs such as Cloudflare Firewall are present and there's no historical DNS to work off of (like Upwork's program, for example)
- In a realistic CTF or lab environment where lateral movement is necessary to make any progress
I take absolutely no legal responsibility for the misuse of this software against any target that you lack written authorization to test. Responsibility is squarely on the user to ensure that this C2 framework is used legally, ethically, and responsibly.
Because I have yet to be offered a real-world engagement that would allow proper testing of this beast and isn't HTB-confidential stuff, I currently do not have the system resources to adequately test this. As such, those with access to more than one powerful machine capable of running powerful LLMs is going to need to test this on either a production network, a large room with many physical machines in it, or an AI lab environment that isn't as closed off as HTB's.
PRs and issue reports are welcome! If during testing any issues are discovered, feel free to report them and I'll look into it.
- MCP core
- Pivoting (via the
mcp_pivottool, which LLMs can use to spin up clones of the original MCP server to cross subnet boundaries) - Tensor steganography (via the
encode_lsb,decode_lsb,encode_lsb_from_image,payload_enc,export_encoded, andimport_imageMCP tools) - Exfiltration (via the
download_fileandupload_filetools) - Command execution (via the
run_system_commandtool) - On-the-fly payload generation/compilation (via the
build_windows_payloadtool; still needs major testing) - Dynamic listener port allocation using
random.randint()to make fingerprinting more difficult - MCP-based staging (via the
stage_encodedtool, which uses tensor steganography to hide an encoded MCP client inside a model that already exists on the target system, if discovered, and exports the resulting modified model data as a JSON object) - Reflective in-memory package installation (via the
pip_downloadtool, which downloads a package along with all its dependencies, bundles all of them into a ZIP file, and hosts the resulting ZIP file as abytesobject for the agent to unpack and install software from)
- Fix issues raised by former classmate John Drexler
- Dead placeholder session ID in middleware
- Shell loop logic flaws (infinite loop)
- Wildcard imports
- Encoding values for binary reads (change rb to r when loading Base64 and only perform binary reads from BytesIO after decoding completes)
- Add server-side model as a C2 operator stand-in: the user can prompt the AI operator instead of relying on a human operator
- Place this server-side model's generation logic in the middleware
- Planned tools to add:
get_operator_instructions: tool that allows deployed agents to prompt the server-side modelinject_chat_template: tool that usesAutoTokenizer.from_pretrainedto allow deployed agents to pull off priming attacks against a wide range of target models
- Beaconing / sleep obfuscation
- Use of PyInstaller to create a standalone Windows executable for deployment to target systems
- In-memory LLM loading
- GUI using Qt/PySide2