skip to content

In GTFOBins, what do a function and a context each describe, and how do you read one pairing of them as a risk statement?

level: middleimportance: should knowfreq 32%

answer

  1. what it can do versus under what condition
  2. eleven functions, four contexts
  3. privilege is not dropped
  4. the pair is the claim

basics

~20 s

A function names what an executable can be made to do, such as File read or Shell; a context names the condition that makes it work: Unprivileged, Sudo, SUID or Capabilities. One pairing says what a grant hands over.

solid answer

~40 s

GTFOBins files each executable under functions (eleven on the gtfobins.org index read on 2026-10-04: Shell, Command, Reverse shell, Bind shell, File write, File read, Upload, Download, Library load, Privilege escalation, Inherit) and, for each function, under the contexts in which it works: Unprivileged, Sudo, SUID and Capabilities. Under Sudo the function runs with the privileged user's rights because the privileges are not dropped; under SUID the effective privileges are not dropped; under Capabilities the kernel's permission checks are bypassed and the entry lists the capabilities needed. A pairing such as File read under Sudo reads as: this grant lets the user read what the privileged account can read. That is the risk statement you compare with what the grant was meant for.

go deeper

for a junior

Know that a function is what a program can do, a context is when it works, and name the four contexts.

for a middle

Explain how each context describes privilege not being dropped and turn a pairing such as File read under Sudo into a plain statement about what a grant hands over.

for a senior

Judge a pairing against the intent of the grant, and follow Inherit references so a review does not stop at the first program named.

for a principal

Set the vocabulary a review board uses so findings read as function under context, consistently, across teams and tools.

## The filing scheme GTFOBins files each executable by **function** (what it can be made to do) and, for every example of a function, by **context** (the condition under which it works). Both vocabularies are fixed by the project's data files, so a finding can use the same words as the catalogue. As read on 2026-10-04 the index lists eleven functions and four contexts. | Function | What the catalogue says it covers | |---|---| | Shell | The executable can start an interactive system shell. | | Command | It can run non-interactive system commands. | | Reverse shell | It can send a shell back to a listener. | | Bind shell | It can bind a shell to a local port. | | File write | It can write data to local files. | | File read | It can read data from local files. | | Upload | It can send local data elsewhere. | | Download | It can fetch remote data. | | Library load | It can load shared libraries that run code in the same execution context. | | Privilege escalation | It indirectly enables elevated privileges, for example by changing the SUID bit or ownership of another executable. | | Inherit | It can inherit functions from another executable, which the entry names. | ## The four contexts | Context | Meaning in the catalogue | |---|---| | Unprivileged | Any unprivileged user can perform the function. | | Sudo | The function is performed as the privileged user when run through `sudo`, because the acquired privileges are not dropped. | | SUID | The function is performed as the file's owner when the SUID bit is set and the ownership is right, because the *effective* privileges are not dropped. | | Capabilities | The function bypasses the usual kernel permission checks when the executable holds certain capabilities; the entry lists the `CAP_*` names needed. | The mechanics behind these rows (how the kernel treats the set-user-ID bit, how sudoers rules are evaluated, how capability sets work) belong to the Linux permission topics. Here only the catalogue's vocabulary matters. ## Reading one pairing as a risk statement 1. **Pick the grant you are reviewing.** A line in a sudo rule, a file with the SUID bit or a file with capabilities. 2. **Pick the matching context.** Sudo for the rule, SUID for the bit, Capabilities for the file capability. 3. **Read the functions listed under that context** for the program. 4. **Translate each function into a statement about authority.** File read under Sudo means the user can read anything the privileged account can read. Shell under SUID means the bit can give a shell running with the owner's privileges. File write under Sudo means the user can alter files the privileged account can alter. 5. **Compare with intent.** If the grant was meant to let someone rotate a log, a documented File write or Shell function is more than was requested. ## Details worth knowing - **Inherit** is a pointer, not a capability of its own: the entry names another executable whose functions this one can enable, so you follow the reference and read that program as well. - **Privilege escalation** as a function is narrower than the phrase suggests; it describes mechanisms that indirectly enable elevated privileges, such as altering another file's SUID bit or ownership. - **Unprivileged** crosses no privilege boundary, but it still matters where an account is confined: a restricted shell, a tool allowed to a CI job or a minimal image. - **Capabilities** entries are far fewer than Sudo or SUID entries in the 2026-10-04 clone, so a lookup under that context says little about what a file capability permits. - An entry's optional notes can state version or operating-system requirements, so an entry says what can happen, not what will on your host. ## Common mistakes Reading a function name as a vulnerability class, reading the context as the operating system, assuming Unprivileged means harmless, and treating a pairing as proof that a particular host is exposed. The pairing is a claim about what the grant hands over; whether it is a finding depends on whether anyone intended that.

  • Why does an entry listed only under the Unprivileged context still matter in a hardening review?
    No privilege boundary is crossed, but a restriction may be. Where an account is confined to a restricted shell, a small allowed toolset or a minimal container image, a listed function shows that an allowed program can do more than the confinement intended. It matters for scoping those environments, not for sudo or SUID audits.
  • How do you read an entry whose function is Inherit?
    Follow it. The entry names another executable whose functions it can enable, so granting the first program also grants whatever the second one lists under the same context. In an audit, add both programs to the lookup instead of judging the first on its own.

  • Treats each GTFOBins function as a vulnerability class
  • Reads a context as an operating system or distribution
  • Assumes the Unprivileged context means harmless
  • Reads any listed pairing as proof the host is exploitable
  • Counts Inherit as a separate attack rather than a pointer