TuoniPayloadPlugin

class tuoni.TuoniPayloadPlugin(conf, c2)[source]

A class that provides data for a payload plugin.

name

The name of the payload plugin.

Type:

str

vendor

The vendor of the payload plugin.

Type:

str

description

A description of the payload plugin.

Type:

str

plugin_id

The unique identifier of the payload plugin.

Type:

str

templates

A list of available payload templates.

Type:

list

Examples

Iterate over payload plugins, inspect their templates, and create a payload for each type defined in the template’s configuration schema:

>>> payload_plugins = tuoni_c2.load_payload_plugins()
>>> for plugin in payload_plugins.values():
...     print(f"Plugin: {plugin.name} ({plugin.plugin_id})")
...     for template in plugin.templates:
...         print(f"  Template: {template.id}")
...         type_values = (
...             template.conf_schema
...             .get("properties", {})
...             .get("type", {})
...             .get("enum", [])
...         )
...         for type_value in type_values:
...             payload = TuoniPayload(
...                 conf={
...                     "templateId": template.id,
...                     "configuration": {"type": type_value}
...                 },
...                 c2=tuoni_c2
...             )
...             payload.create(listener_id=1)
...             print(f"    Created payload ID: {payload.payload_id}")