Summary
This uses AppleEvents to inject the shell command, , into the specified terminal shell as if the user typed it from the keyboard. This is pretty powerful. Consider the instance where the user is SSH-ed into another machine via terminal - with this you can inject commands to run on the remote host. Just remember, the user will be able to see the command, but you can always see what they see as well with theterminals_read command.
- Needs Admin: False
- Version: 1
- Author: @its_a_feature_
Arguments
window
- Description: window # to send command to
- Required Value: True
- Default Value: None
tab
- Description: tab # to send command to
- Required Value: True
- Default Value: None
command
- Description: command to execute
- Required Value: True
- Default Value: None
Usage
MITRE ATT&CK Mapping
- T1059
- T1184
Detailed Summary
To get the window/tab combination needed for this command, runterminals_read first. This uses Terminal’s own AppleEvent API to accept and execute commands.