How Plugins Work#
TantoC2 uses a generic PluginRegistry class that discovers plugins from designated directories. All plugin types share the same discovery mechanism:
- Scan
.pyfiles in the plugin directory (excluding_-prefixed files) - Import each file
- Find all concrete subclasses of the base class
- Register by
plugin_name()
No code changes to the core system are required to add new plugins.
Plugin Base Class#
Every plugin extends PluginBase:
| |
Plugin Types#
| Type | Base Class / Format | Directory | Description |
|---|---|---|---|
| Transport | TransportBase | plugins/transports/ | Listener implementations |
| Tools Module | AgentlessModuleBase | plugins/agentless/ | Direct service interaction (SSH, SMB, etc.) from the teamserver |
| Agent Package | AgentPackageBase | plugins/agent_packages/ | Crypto, codec, build pipeline, and capability declarations |
| Agent Module | YAML manifest + compiled payload | agent_modules/ | Compiled payloads loadable by agents (BOF, shellcode, DLL, etc.) |
Hot-Reload#
Drop a .py file into the appropriate directory and trigger a refresh:
CLI:
| |
API:
| |
No server restart required.
Plugin Inbox#
For easy deployment, drop files into the plugin inbox directory (plugin_inbox_dir config). The plugin watcher automatically handles them:
.pyfiles: Auto-detected by type and moved to the correct plugin directory.whlfiles: Installed via pip, then registered through entry points
The inbox is checked every bg_plugin_watcher_interval seconds (default: 30).
Dependency Auto-Install#
Modules can declare pip dependencies in their metadata via dependencies: list[str]. Missing packages are auto-installed at discovery time. If installation fails, the module is tracked as unavailable with a reason — queryable via the unavailable_modules property on the module manager.
Deployment#
Place your plugin file in the correct directory:
| |
Or drop into the plugin inbox for automatic routing.
The plugin is discovered on the next server start, refresh, or inbox scan.
Next Steps#
- Agent Packages — crypto, wire protocol, and capability declarations
- Agent Modules — compiled payloads loaded into agents
- Transport Plugins — listener implementations
- Tools Modules — direct protocol interaction