Skip to main content

Parameters

The array of parameters shown here are the ones that are presented to the operator when building their payload. These should be things that the Payload will need in order to successfully talk through your C2 Profile.
What if your Server and Payload need some shared piece of data? There’s a ConfigCheck function that’s called that you can define here that will provide the full payload configuration. You can take this config and update something on your server-side configuration to keep parity between the two.
parameters example
parameters = [
    C2ProfileParameter(
        name="callback_host",
        description="Callback Host",
        default_value="ws://127.0.0.1",
        verifier_regex="^(ws|wss)://[a-zA-Z0-9]+",
        required=True
    ),
    C2ProfileParameter(
        name="AESPSK",
        description="Crypto type",
        default_value="aes256_hmac",
        parameter_type=ParameterType.ChooseOne,
        choices=["aes256_hmac", "none"],
        required=False,
        crypto_type=True
    ),
    C2ProfileParameter(
        name="callback_interval",
        description="Callback Interval in seconds",
        default_value="10",
        verifier_regex="^[0-9]+$",
        required=False,
    ),
    C2ProfileParameter(
        name="encrypted_exchange_check",
        description="Perform Key Exchange",
        parameter_type=ParameterType.Boolean,
        default_value=True,
        required=False,
    ),
    C2ProfileParameter(
        name="killdate",
        description="Killdate for when the C2 Profile should stop working and exit the agent",
        default_value=365,
        parameter_type=ParameterType.Date,
    ),
]

Parameter Components

So what are all these components in the Parameter definitions?
  • name - What is the name of the parameter
    • this is how you’ll get the value for this parameter during build time
  • description - The long form description of what this value means
  • default_value - What is the default value for this parameter
  • verifier_regex - Optional feature you can use to provide a regex that indicates if a value is valid or not for the operator
  • required - Is this field required for the operator to fill out
  • parameter_type - What type of parameter is this:
    • String - you get a string value
    • ChooseOne`` - you get a string` value
    • ChooseOneCustom - you get a string value
    • ChooseMultiple - you get an array of string values
    • Array - you get an array of string values
    • Date - you get a string representation of the Date as YYYY-MM-DD
    • Dictionary - you get a dictionary representation, or map[string]string in Go
    • Boolean - you get a bool value
    • TypedArray - you get an array of tuples
      • this will either be something like [ ["type", "value"], ["type", "value"] ] if the UI modal was used
      • this will be something like [ ["", "user typed"], ["", "user typed"] ] and sent to your typed_array_parse function in the case that the user just typed something and needs parsing into the above format
    • File - you will get a string UUIDv4 value that you can use to upload/download via chunking
    • FileMultiple - you will get an array of string UUIDv4 values that you can use to upload/download via chunking
    • Number - you will get an int in Python and a float64 in Go by default