TuoniPayload

class tuoni.TuoniPayload(conf=None, c2=None)[source]

A class that provides data and functionality for a sent payload.

payload_id

The unique identifier of the payload.

Type:

int

template_id

The unique identifier of the payload template used to create the payload.

Type:

str

template_name

The name of the payload template used to create the payload.

Type:

str

configuration

The configuration settings for the payload.

Type:

dict

listeners

The listeners associated with the payload.

Type:

list

os

The operating system for the payload.

Type:

str

architecture

The architecture for the payload.

Type:

str

status

The status of the payload.

Type:

str

encrypted_communication

Indicates if the communication is encrypted.

Type:

bool

Examples

Create a payload from a conf dict and save it to disk:

>>> payload = TuoniPayload(
...     conf={
...         "templateId": "shelldot.payload.windows-x64",
...         "configuration": {"type": "executable"}
...     },
...     c2=tuoni_c2
... )
>>> payload.create(listener_id=1)
>>> print(f"Created payload with ID: {payload.payload_id}")
>>>
>>> # Download and save the payload binary
>>> data = payload.download()
>>> with open("agent.exe", "wb") as f:
...     f.write(data)
>>>
>>> # Delete the payload when done
>>> payload.delete()
create(listener_id)[source]

Create the payload on the C2 server.

Parameters:

listener_id (int) – The ID of the listener to associate with this payload.

Examples

>>> payload = TuoniPayload(
...     conf={
...         "templateId": "shelldot.payload.windows-x64",
...         "configuration": {"type": "executable"}
...     },
...     c2=tuoni_c2
... )
>>> payload.create(listener_id=1)
delete()[source]

Delete the payload from the C2 server.

download()[source]

Download the payload from the C2 server.

Returns:

The binary data of the downloaded payload.

Return type:

bytes

load(id)[source]

Load the payload data from the C2 server using the payload ID.

Parameters:

id (int) – The unique identifier of the payload to load.

update()[source]

Update the payload configuration on the C2 server.

Parameters:

new_configuration (dict) – The new configuration settings for the payload.