Skip to main content
C2 file hosting lets an operator expose a Mythic file or payload at a path handled by a C2 profile. Mythic 4.0 manages these hosted-file records from the UI and sends add/remove batches to the profile’s host_file function.

Implement the handler

Request contract

Each batch identifies the C2 profile and contains one or more files:
  • agent_file_id is the Mythic file UUID.
  • host_url is the profile-specific route selected by the operator.
  • remove distinguishes removal from creation or refresh.
  • download_token is a file-scoped mctx_ bearer token the C2 profile can use to fetch the file from Mythic. Mythic rotates or invalidates it as the hosted-file state changes; do not log or persist it.
  • filename is the operator-facing filename.
Return one result for each requested entry so Mythic can update individual rows even when part of a batch fails. Set RestartInternalServer only when the profile must restart its internal server to activate the route changes.

Operator workflow

Blue globe actions on payload and file views open the C2 hosting dialog. The operator chooses a compatible C2 profile and a URL. Existing entries can be refreshed, retried, stopped, or removed from the hosted-files management view.
Treat host_url as untrusted operator input. Normalize it and prevent path traversal or collisions according to the C2 server’s routing model.