Skip to content

Add a crypto provider template - #4

Open
0xd6cb6d73 wants to merge 1 commit into
MythicMeta:mainfrom
0xd6cb6d73:storage-commit-contract
Open

0xd6cb6d73 wants to merge 1 commit into
MythicMeta:mainfrom
0xd6cb6d73:storage-commit-contract

Conversation

@0xd6cb6d73

Copy link
Copy Markdown

Summary

its-a-feature/Mythic#617 adds crypto providers to Mythic: separate services that implement an agent's cryptographic protocol, while Mythic keeps handling transport and routing. This PR adds Payload_Type/crypto_provider, a starting point for writing one, next to the existing payload type and C2 profile examples.

The template is a complete service with the cryptography left out. To build a provider, you implement four hooks.

What's included

Service

  • Registers with Mythic as a crypto container and advertises its capabilities.
  • Listens on its <name>_crypto_provider_rpc queue and handles requests concurrently.
  • Checks each request before handling it: the mythic-auth-context header must match the request's auth_context.
  • Exits cleanly on SIGTERM, or when its broker connection closes, so that the container restarts.

Provider hooks (internal/provider)

  • One hook for each method: prepare_profile, begin_session, open and seal.
  • Each hook rejects requests until you implement it.
  • The comments explain the retry rules a real provider must follow: save each result together with its state change, and answer an identical retry from get_result.

Storage client (internal/storage)

  • Wraps Mythic's storage RPC (load, commit and get_result), so a provider can keep its state in Mythic's database instead of running its own.

Scaffolding

  • A Dockerfile, a Makefile, .env.example, and a README on running the service and integrating an agent.

The template uses the Go types from MythicContainer's cryptoproviderstructs package (MythicMeta/MythicContainer#12).

🤖 Generated with Claude Code

Payload_Type/crypto_provider is a starting point for a Mythic crypto
provider: a consuming container of type crypto that implements an
agent's cryptographic protocol. It is a complete Go service with no
cryptography in it.

- internal/service registers with Mythic as a crypto container,
  consumes its <name>_crypto_provider_rpc queue, checks each request's
  mythic-auth-context and handles requests concurrently.
- internal/provider has one hook for each of prepare_profile,
  begin_session, open and seal. Each rejects requests until it is
  implemented.
- internal/storage is a client for Mythic's storage RPC: load, commit
  and get_result.
- internal/wirecheck checks messages against the rules and limits of
  Mythic's crypto provider API; the SDK declares only the types.
- internal/transport adapts the MythicContainer SDK's RabbitMQ
  connection.

go.mod points MythicContainer at the fork with the crypto provider types
until they are released. The template's README covers running,
installing and agent integration, and the repository README links it.

Co-authored-by: Codex <codex@openai.com>
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant