command¶
Execute shell commands on the guest VM with support for output capture, elevated privileges, and variable substitution.
Usage Examples¶
Simple Command
actions:
- command:
command: "mkdir -p /evidence/case_001"
shell: true
description: "Create evidence directory"
Capture Output
actions:
- command:
command: "whoami"
capture:
variable: current_user
description: "Get current username"
- command:
command: "echo '{{ current_user }}'"
description: "Use captured variable"
Parse Output
actions:
- command:
command: "echo '42'"
capture:
variable: count
parser: "int(output.strip())"
description: "Capture and parse integer"
Elevated Privileges
actions:
- command:
command: "msi /i Tool.msi /quiet"
admin: true
description: "Install with administrator rights"
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Shell command to execute (required) |
|
boolean |
Execute in shell context (default: false) |
|
CaptureSpec |
Capture command output to variable |
|
boolean |
Run with elevated privileges (default: false) |
|
string |
Working directory for command execution |
|
dict |
Environment variables |
|
float |
Command timeout in seconds |
|
boolean |
Continue on non-zero exit code (default: false) |
|
string |
Human-readable description (optional) |
Capture Specification¶
Parameter |
Type |
Description |
|---|---|---|
|
string |
Variable name to store output (required) |
|
string |
Output source: |
|
string |
Python expression to parse output (e.g., |
Notes¶
Commands support Jinja2 variable substitution
Parser expressions have access to:
output,json,re,str,int,floatUse
shell: truefor commands with pipes, redirects, or wildcardsCaptured variables available in subsequent actions and flow control
See Also¶
save_variable for storing computed values
stop for conditional execution based on command output
continue for skipping iterations based on output