Identifier / Programs / Linux and Unix
zgrep
Grep text patterns from files within compressed files. tldr-pages
GTFOBins file-read 1 documented command
How zgrep is abused
file-read
Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for zgrep.
1 documented command
file-read unprivileged, with sudo
grep '' /path/to/input-fileThis command is 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 zgrep. The identifier reads the line that runs zgrep.
Everyday use
Grep a pattern in a compressed file (case-sensitive)
zgrep pattern path/to/compressed_fileIdentifyPrint 3 lines of Context around, Before, or After each match
zgrep --context 3 pattern path/to/compressed_fileIdentifyGrep a pattern in a compressed file (case-insensitive)
zgrep --ignore-case pattern path/to/compressed_fileIdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.