Identifier / Programs / Linux and Unix
chmod
Change the access permissions of a file or directory. tldr-pages
GTFOBins privilege-escalation 2 Sigma rules name it 1 ATT&CK technique 1 documented command
How chmod is abused
privilege-escalation
Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for chmod.
1 documented command
privilege-escalation with sudo, as SUID
This can be run with elevated privileges to change permissions (6 denotes the SUID bits) and then read, write, or execute a file.
chmod 6777 /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 chmod. The identifier reads the line that runs chmod.
What detects it
Everyday use
Give the user who owns a file the right to execute it
chmod u+x path/to/fileIdentifyGive the user rights to read and write to a file/directory
chmod u+rw path/to/file_or_directoryIdentifyRemove executable rights from the group and others
chmod g-x,o-x path/to/fileIdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.
Options
Show every option of chmod
-cPrint changes-fDon't print errors-RRecursive-vVerbose