Build Parameters
Build parameters are defined on a payload type’s definition and allow you to configure a payload build in a way outside of C2 specific configurations. These parameters are defined in an array with a few specific fields. Below are examples in Python and Go:- Python
- Go
name- the name of the parameter (this is required)description- the description of the parameter - this is displayed along with the name to give users more context about what the parameter is doingrequired- this indicates if the user is required to specify something or notparameter_type- this is the type of value for this and can be boolean, number, choose one, choose multiple, file, string, dictionary, date, array (of strings), array of filesdefault_value- the default value for the fieldchoices- a list of choices to present for a choose one or choose multiple displaysupported_os- optional list of strings of operating systems that work with this parameter. This is the same “OS” selection that you specify as part of your supported os for the payload type definition. For example, if this is “Linux”, but the user selected “macOS”, then this option will NOT be presented to the user.group_name- optional name you can specify to group parameters together logically in the UIhide_conditions- an optional list of HideConditions (only one element in the hide condition needs to be true for the entire thing to be hidden)
Hide Conditions
Hide conditions on a build parameter allow you specify, based on the values of other build parameters, if the current build parameter should be hidden from view or not. A good example would be to hide build parameters related to shellcode options if another option specify the output type isn’t shellcode. Hide Conditions are generally defined as:name- this specifies the name of the OTHER build parameter that you’re looking atoperand- this specifies the “operand” that we’re going to use. This can be one of the following:- EQ = “eq”
- NotEQ = “neq”
- IN = “in”
- NotIN = “nin”
- LessThan = “lt”
- GreaterThan = “gt”
- LessThanOrEqual = “lte”
- GreaterThanOrEqual = “gte”
- StartsWith = “sw”
- EndsWith = “ew”
- Contains = “co”
- NotContains = “nco”
value- this is what we’re comparing the current option’s value to. In the above example, we would HIDE that build parameter if theoutput_typebuild parameter’s value is Not EQ to the value Shellcode.- if you’re using
inornin, then instead ofvalueyou’d specifychoices
- if you’re using
C2 Parameter Deviations
This is another really powerful addition in Mythic 3.4 - the ability for a payload type to define a variation to a supported c2 profile. This is part of the payload type’s definition, but allows you to make light modifications to any parameter for a supported c2 profile. The only thing you can’t do is add new parameter values - only remove or modify.- Python
- Go
supported- indicate if this field is supported or not. If it’s not supported, then it won’t be shown to the user.default_value- your own default value instead of the one that’s normally providedchoices- your own set of choices instead of those that are provideddictionary_choices- your own set of dictionary choice objects instead of what’s normally provided
Dynamic Parameters and Mythic 4.0 parameter additions
Build parameters can set different values and labels shown to operators, control UI order, query choices dynamically, and collect structured JSON strings. Dynamic Query Parameters are executed when the parameter is first shown to the user, but comes with a special button to re-run and update the choices at will.OtherParameters contains the other values currently selected in the build form, which lets a dynamic query return choices conditioned on prior input.
Return Choices for identical Display Value and actual value strings or ComplexChoices for independent DisplayValue and Value fields.
The complete v4 fields added to these definitions are:
display_name— custom display name to show in the UI;nameremains the stable build keychoices_display_names— map stored choice values to UI labelsui_position— explicit ordering within a groupdynamic_query_function— populateChooseOneorChooseMultiplevalues when the form needs themjson_string_schema— drive synchronized visual/source editing forBuildParameterType.JSONString
Expanded hide-condition operands
In addition toeq, neq, in, and nin, v4 supports numeric comparisons lt, gt, lte, and gte, and string tests sw (starts with), ew (ends with), co (contains), and nco (does not contain).
Multiple conditions remain OR-ed: if any condition matches, Mythic hides the parameter.