Author: MatrixTM26
GitHub: MatrixTM26
Important
Copying without owner permission is illegal. If you want to expand this project, ask the owner for collaboration instead.
TOMCAT C2 is a multi-protocol Command & Control framework supporting three types of incoming connections on a single port:
- Native TOMCAT agents
- Meterpreter sessions
- Generic reverse shells
The framework supports Mutual TLS (mTLS) for authenticated and encrypted agent communication while also shipping with a built-in PKI infrastructure for certificate generation and management.
TOMCAT-C2 combines multi-session management, encrypted communication, multi-interface administration, and multi-protocol session handling into a single unified framework.
- Multi-Protocol β single listener accepts TOMCAT agents, Meterpreter, and reverse shells simultaneously
- mTLS Support β mutual TLS with CA-signed client certificates; only authorized agents can connect
- Fernet Encryption β encrypted end-to-end communication using symmetric Fernet keys
- Three Interfaces β CLI, Flask Web Panel, and Tkinter GUI
- Built-in PKI β generate CA certificates, server certificates, and per-agent certificates directly from CLI
- Agent Packaging β auto-generates deployable agent folders with certificates and scripts
- Certificate Management β generate, revoke, and manage issued certificates
- File Transfer β upload and download files between server and agent
- Session Commands β sysinfo, screenshot, elevate, upload, download, shell execution, and task management
- Persistence β optional Windows Registry and Linux Cron persistence
- Multi-Session β manage multiple sessions concurrently
- Interactive Console β fully interactive session handling with shell support
- Cross-Protocol Detection β automatic session identification based on incoming traffic
git clone https://github.com/MatrixTM26/TOMCAT-C2.gitpip install -r requirements.txtPython 3.8+
cryptography
flask
pysocks
TOMCAT-C2
βββ AGENT
βΒ Β βββ Shell
βΒ Β βΒ Β βββ shell-2.java
βΒ Β βΒ Β βββ shell-2.js
βΒ Β βΒ Β βββ shell-3.java
βΒ Β βΒ Β βββ shell.asm
βΒ Β βΒ Β βββ shell.c
βΒ Β βΒ Β βββ shell.cpp
βΒ Β βΒ Β βββ shell.cr
βΒ Β βΒ Β βββ shell.dart
βΒ Β βΒ Β βββ shell.go
βΒ Β βΒ Β βββ shell.hs
βΒ Β βΒ Β βββ shell.java
βΒ Β βΒ Β βββ shell.js
βΒ Β βΒ Β βββ shell.md
βΒ Β βΒ Β βββ shell.pl
βΒ Β βΒ Β βββ shell.ps1
βΒ Β βΒ Β βββ shell.py
βΒ Β βΒ Β βββ shell.sh
βΒ Β βββ tomcatv2a.bat
βΒ Β βββ tomcatv2a.cs
βΒ Β βββ tomcatv2a.go
βΒ Β βββ tomcatv2a.java
βΒ Β βββ tomcatv2a.js
βΒ Β βββ tomcatv2a.php
βΒ Β βββ tomcatv2a.ps1
βΒ Β βββ tomcatv2a.py
βΒ Β βββ tomcatv2a.rb
βΒ Β βββ tomcatv2a.sh
βΒ Β βββ tomcatv2a.vbs
βββ CHANGELOG.md
βββ Certs
βΒ Β βββ AgentTCF
βΒ Β βββ Metadata.json
βΒ Β βββ ca-cert.pem
βΒ Β βββ ca-key.pem
βΒ Β βββ server-cert.pem
βΒ Β βββ server-key.pem
βββ LICENSE
βββ QUICKSTART.md
βββ README.md
βββ doc
βΒ Β βββ AUTHORS
βββ images
βΒ Β βββ logo.png
βββ install.sh
βββ lib
βΒ Β βββ config
βΒ Β βΒ Β βββ Color.py
βΒ Β βΒ Β βββ Helper.py
βΒ Β βΒ Β βββ Logo.py
βΒ Β βΒ Β βββ static
βΒ Β βΒ Β βΒ Β βββ css
βΒ Β βΒ Β βΒ Β βΒ Β βββ style.css
βΒ Β βΒ Β βΒ Β βββ js
βΒ Β βΒ Β βΒ Β βββ script.js
βΒ Β βΒ Β βΒ Β βββ sidebar
βΒ Β βΒ Β βΒ Β βΒ Β βββ sidebar.js
βΒ Β βΒ Β βΒ Β βββ themes
βΒ Β βΒ Β βΒ Β βββ theme.js
βΒ Β βΒ Β βββ templates
βΒ Β βΒ Β βββ index.html
βΒ Β βββ core
βΒ Β βββ App
βΒ Β βΒ Β βββ App.py
βΒ Β βΒ Β βββ Cli.py
βΒ Β βΒ Β βββ Gui.py
βΒ Β βββ Systems
βΒ Β βββ CertificateManager.py
βΒ Β βββ Cryptography.py
βΒ Β βββ MultiProtocolServer.py
βΒ Β βββ Server.py
βΒ Β βββ System.py
βββ requirements.txt
βββ start.py
Required for mTLS communication.
python3 start.py --init-certsSpecify custom server IP:
python3 start.py --init-certs --server-host 192.168.1.10python3 start.py --gen-agent myagent --agent-host 192.168.1.10 --agent-port 4444 --agent-mtlsGenerated structure:
IMPLANT/MYAGENT/
βββ tomcatv2a.py
βββ agent-key.pem
βββ agent-cert.pem
βββ ca-cert.pem
βββ README.txt
Run agent:
python3 tomcatv2a.pypython3 start.py -Cpython3 start.py -C -Tpython3 start.py -C -M -Tpython3 start.py C2 Server Agent
βββββββββ βββββββββ
ca-cert.pem βββ shared trust βββΊ ca-cert.pem
server-key.pem agent-key.pem
server-cert.pem agent-cert.pem
β β
βββββββββ TLS mutual auth ββββββββββ
The Certificate Authority signs both server certificates and agent certificates. During the TLS handshake, both sides verify each other using the same trusted CA.
Agents without valid CA-signed certificates are rejected during SSL negotiation before any protocol communication occurs.
When Multi-Protocol Mode is enabled, TOMCAT-C2 automatically detects incoming session types based on the first incoming bytes.
| First Bytes | Detected As |
|---|---|
| TLS ClientHello | TOMCAT Agent |
| Meterpreter Header | Meterpreter Session |
| UTF-8 Shell Prompt | Reverse Shell |
This allows all supported session types to operate simultaneously on a single listening port.
python3 start.py --init-certspython3 start.py -a agent01 -ah 10.0.0.1 -ap 4444 -ampython3 start.py -m -c 5 -u op1 -ah 10.0.0.1 -ap 4444 -ampython3 start.py -lpython3 start.py -r agent01Certificates are stored inside:
Certs/
βββ AgentTCF/
βββ Metadata.json
βββ ca-cert.pem
βββ ca-key.pem
βββ server-cert.pem
βββ server-key.pem
| Command | Description |
|---|---|
sessions |
List active sessions |
use <id> |
Open interactive shell |
exec <id> <cmd> |
Execute command |
kill <id> |
Terminate session |
status |
Server status |
stats |
Session statistics |
logs |
View logs |
clear |
Clear terminal |
help |
Show help |
exit |
Shutdown server |
| Command | Description |
|---|---|
sysinfo |
System information |
elevate |
Privilege escalation checks |
screenshot |
Capture screenshot |
download |
Download file |
upload |
Upload file |
cd |
Change directory |
stoptask |
Stop current task |
back |
Return to main console |
- Keep
ca-key.pemandserver-key.pemsecure - Never deploy private server keys to agents
- Each agent receives unique certificates
- Use
--mtlsin production deployments - Fernet keys regenerate on every server restart
- Author: @MatrixTM26
- License: AGPL-V3
Copyright Β©2023-2026 MatrixTM26 Β· All Rights Reserved




