Monarch C2
  • Introduction to Monarch
  • Installation
    • Resources
    • Uninstall Monarch
  • Interface
  • Features
    • External integration
    • Multiplayer
    • Management (server)
    • HTTP customization
  • Architecture
  • Usage
    • Builders
    • Agents
    • Listeners
    • Stage
    • Sessions
    • Players (server)
    • Chat
  • Integration
    • Project configuration
    • Builder
      • Architecture
      • API
      • Build routine
      • Build service
    • C2 server
      • Registering implants
      • Talking to implants
    • Implant development
      • Registration
      • Tasks
      • The TCP handler
Powered by GitBook
On this page
  1. Integration
  2. Builder

Build service

The actual Python builder service can be set up in just a few lines of code, thanks to the Monarch API. All that is needed is to create a new service object, register your callback, and start the listener.

from monarch.builder import *

def routine(req: BuildRequest) -> BuildResponse:
    # define your routine here
    return BuildResponse(...)

if __name__ == "__main__":
    service = builder_service(BuildFunction(routine))
    service.serve_forever()

Last updated 1 year ago