pub enum Payload {
Shellcode {
bytes: Vec<u8>,
metadata: PayloadMetadata,
},
DllFile {
file_path: Option<PathBuf>,
image_bytes: Option<Vec<u8>>,
metadata: PayloadMetadata,
},
Executable {
file_path: Option<PathBuf>,
image_bytes: Option<Vec<u8>>,
metadata: PayloadMetadata,
},
Script {
language: String,
script_code: String,
metadata: PayloadMetadata,
},
Blob {
content_type: String,
data: Vec<u8>,
metadata: PayloadMetadata,
},
}Expand description
A unified representation of the code or data to be injected.
This enum wraps the raw bytes or file paths of the payload and attaches
PayloadMetadata to ensure operational context is carried throughout the injection lifecycle.
Variants§
Shellcode
Raw position-independent shellcode.
DllFile
A Dynamic Link Library (DLL), either as a file path or raw image bytes.
Fields
metadata: PayloadMetadataExecutable
A Portable Executable (EXE), either as a file path or raw image bytes.
Fields
metadata: PayloadMetadataScript
A high-level script (e.g., PowerShell, Python, Bash) to be executed by an interpreter.
Fields
metadata: PayloadMetadataBlob
A generic binary blob with a specified content type.
Useful for stagers or data that does not fit standard executable formats.
Implementations§
Source§impl Payload
impl Payload
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Returns a string literal representing the variant name (e.g., “Shellcode”, “DllFile”).
Sourcepub fn as_file_path(&self) -> Option<&Path>
pub fn as_file_path(&self) -> Option<&Path>
Returns the file path if this payload is backed by a file on disk (DLL or Executable).