Summary
This runs in a terminal by leveraging JXA’sApplication.doShellScript({command}).
WARNING! THIS IS SINGLE THREADED, IF YOUR COMMAND HANGS, THE AGENT HANGS!
- Needs Admin: False
- Version: 1
- Author: @its_a_feature_
Arguments
command
- Description: Command to run
- Required Value: True
- Default Value: None
Usage
Without Popup
MITRE ATT&CK Mapping
- T1059
Detailed Summary
This uses the JXA doShellScript command to execute the specified command. A few things to note though:- This is single threaded, so commands executed in this way have a potential to hang the entire agent
- This spawns
/bin/sh -c [command]on the command line - This is actually
/bin/bashemulating/bin/shwhich causes some weirdness, so I do some redirection when you try to actually background a task - This returns results using
\rinstead of\nor\r\nwhich is odd, so that is replaced before being returned.