Considerations
- The agent is single-threaded. While most times this won’t be an issue (other than only being able to run one command at a time), this comes into play for the
shellandshell_elevatedcommands since they spawn a shell command and wait for the program to finish. So, if you run something likeshell sudo whoamiand sudo prompts for the password, your agent will never come back because it’s waiting for that input.
Process Execution
- The
shellcommand spawns/bin/sh -c [command]which is subject to command-line logging. - The
shell_elevatedcommand spawns a series of trampoline processes to elevate your context before finally spawning the/bin/sh -c [command] - The
add_usercommand spawns many instances ofdscl
Potential Popups
The following commands can only use AppleEvents or have the option to use Apple Events which on Mojave+ (10.14+) can generate popups:chrome_bookmarks- reaches out toChromechrome_jsreaches out toChromechrome_tabsreaches out toChromecurrent_userhas an option to use AppleEvents or API callsiTermreaches out toiTermscreenshotcan cause popups in 10.15+lscan cause popups in 10.15+ based on the foldersecurity_inforeaches out toSystem Eventsterminals_readreaches out toTerminal.appterminals_sendreaches out toTerminal.app