shell
Execute local shell commands.
vars:
$SERVER_ADDRESS: 192.42.0.254
$NMAP: /usr/bin/nmap
commands:
- type: shell
cmd: $NMAP $SERVER_ADDRESS
- cmd
The command line to execute locally. Supports variable substitution.
- Type:
str
- Required:
True
- command_shell
The shell used to execute commands.
- Type:
str
- Default:
/bin/sh- Required:
False
Interactive Mode
- interactive
Run the command in interactive mode.
- Type:
bool
- Default:
False- Required:
False
Instead of waiting for the command to finish, AttackMate reads output until no new output appears for
command_timeoutseconds. Useful for commands that require follow-up keystrokes (e.g. openingvimand sending input in a subsequent command).This mode works only on Unix and Unix-like systems.
Warning
Commands executed in interactive mode MUST end with a newline character (
\n).commands: # Open nmap in interactive mode and create a named session: - type: shell cmd: "nmap --interactive\n" interactive: True creates_session: attacker # Send a command to the open interactive session: - type: shell cmd: "!sh\n" interactive: True session: attacker
- creates_session
Name to assign to the interactive session opened by this command. Can be reused in subsequent commands via
session.Only meaningful when
interactiveisTrue.- Type:
str
- Required:
False
- session
Name of an existing interactive session to reuse. The session must have been created previously via
creates_sessionwithinteractiveset toTrue.- Type:
str
- Required:
False
- command_timeout
Seconds to wait for new output before stopping in interactive mode.
- Type:
int
- Default:
15- Required:
False
- read
Wait for output after executing the command. Set to
Falseto return immediately with an empty result, useful for fire-and-forget interactive commands that produce no output.- Type:
bool
- Default:
True- Required:
False
Binary Mode
- bin
Enable binary mode. In this mode,
cmdmust be a hex-encoded string representing the raw bytes to execute.- Type:
bool
- Default:
False- Required:
False
commands: # "6964" is the hex encoding of "id": - type: shell cmd: "6964" bin: true