Identifier / Programs / Linux and Unix
less
Open a file for interactive reading, allowing scrolling and search. tldr-pages
GTFOBins shell 5 Sigma rules name it 1 ATT&CK technique 10 documented commands
How less is abused
shell T1059.004 Command and Scripting Interpreter: Unix Shell
-sEach abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for less.
10 documented commands
command unprivileged
cp /path/to/command ~/.lessfilter
less /etc/hostsIdentifycommand unprivileged, with sudo
LESSOPEN='/path/to/command # %s' less /etc/hostsIdentifyfile-read unprivileged, with sudo, as SUID
less /path/to/input-fileIdentifyfile-read unprivileged, with sudo, as SUID
This can be used to read another file, e.g., when invoked as a pager with some fixed content.
less /etc/hosts
:e /path/to/input-fileIdentifyfile-read unprivileged, with sudo
This can be used to read another file.
LESSOPEN='echo /path/to/input-file # %s' less /etc/hostsIdentifyfile-write unprivileged, with sudo, as SUID
echo DATA | less
s/path/to/output-file
qIdentifyinherit unprivileged, with sudo, as SUID
less /etc/hosts
vIdentifyshell unprivileged, with sudo, as SUID
less /etc/hosts
!/bin/shIdentifyshell unprivileged, with sudo
The optional reset command is needed to receive the echo back of the typed keystrokes.
LESSOPEN="/bin/sh -s 1>&0 2>&0 # %s" less /etc/hosts
resetIdentifyshell unprivileged, with sudo
VISUAL='/bin/sh -s --' less /etc/hosts
vIdentifyNone of the 10 commands the identifier 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 less. The identifier reads the line of each that runs less.
What detects it
Everyday use
Open a file for interactive reading
less path/to/source_fileIdentifyPage down/up
<Space>Go to end/start of file
<G>The example the identifier reads matches no GTFOBins abuse and trips no Sigma process-creation rule.