Identifier / Programs / Linux and Unix
fold
Wrap each line in an input file to fit a specified width and print it to stdout. tldr-pages
GTFOBins file-read 1 documented command
How fold is abused
file-read
-w999Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for fold.
1 documented command
file-read unprivileged, with sudo, as SUID
This corrupts the output by wrapping very long lines at the given width (999).
fold -w999 /path/to/input-fileIdentifyThe command the identifier reads trips no Sigma process-creation rule. This command is, 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 fold. The identifier reads the line that runs fold.
Everyday use
Wrap each line to default width (80 characters)
fold path/to/fileIdentifyWrap each line to width "30"
fold -w30 path/to/fileIdentify-wBreak at WIDTH columns (default 80) toyboxWrap each line to width "5" and break the line at spaces (puts each space separated word in a new line, words with length > 5 are wrapped)
fold -w5 -s path/to/fileIdentify-wBreak at WIDTH columns (default 80) toybox-sWrap at whitespace when possible toyboxNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.
Options
Show every option of fold
-bCount bytes instead of utf-8 unicode columns-sWrap at whitespace when possible-w WIDTHBreak at WIDTH columns (default 80)