CmdID / Programs / Linux and Unix
expect
Script executor that interacts with other programs that require user input. tldr-pages
GTFOBins shell 1 ATT&CK technique 2 documented commands
How expect is abused
shell T1059.004 Command and Scripting Interpreter: Unix Shell
-cEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for expect.
2 documented commands
file-read unprivileged, with sudo, as SUID
The file is read and parsed as an expect command file, the content of the first invalid line is returned in an error message.
expect /path/to/input-fileIdentifyshell unprivileged, with sudo, as SUID
expect -c 'spawn /bin/sh;interact'IdentifyAs SUID:
expect -c 'spawn /bin/sh -p;interact'
None of the 2 commands CmdID reads trips a Sigma process-creation rule. These commands are, with GTFOBins’ notes, from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for expect. CmdID reads the line of each that runs expect.