> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/privesc/permissions/linux-permissions-calculator.md).

# Linux Permissions Calculator

Linux permissions calculator for octal and symbolic notation, SUID, SGID, sticky bit, common modes, and privilege escalation triage.

Search an octal mode such as `755`, `644`, `600`, `4755`, or a symbolic mode such as `rwxr-xr-x` to convert permissions and understand impact.

## Permission Finder

<table data-view="cards" data-full-width="true" data-search="true"><thead><tr><th>Octal</th><th>Symbolic</th><th>Meaning</th><th>Typical Use</th><th>Privesc Risk</th></tr></thead><tbody><tr><td><code>000</code></td><td><code>---------</code></td><td>No permissions</td><td>Locked file</td><td>Low</td></tr><tr><td><code>400</code></td><td><code>r--------</code></td><td>Owner read only</td><td>Private key material</td><td>High if readable by wrong owner</td></tr><tr><td><code>600</code></td><td><code>rw-------</code></td><td>Owner read/write</td><td>SSH keys, configs, secrets</td><td>Medium if owner is service account</td></tr><tr><td><code>640</code></td><td><code>rw-r-----</code></td><td>Owner read/write, group read</td><td>Shared service configs</td><td>High if group exposes secrets</td></tr><tr><td><code>644</code></td><td><code>rw-r--r--</code></td><td>Owner write, everyone read</td><td>Public web files</td><td>High for secret files</td></tr><tr><td><code>660</code></td><td><code>rw-rw----</code></td><td>Owner/group read/write</td><td>Team-managed files</td><td>High if group can edit privileged scripts</td></tr><tr><td><code>664</code></td><td><code>rw-rw-r--</code></td><td>Owner/group write, everyone read</td><td>Collaborative files</td><td>Medium to high</td></tr><tr><td><code>666</code></td><td><code>rw-rw-rw-</code></td><td>Everyone read/write</td><td>Rarely appropriate</td><td>Critical for configs, scripts, or auth files</td></tr><tr><td><code>700</code></td><td><code>rwx------</code></td><td>Owner full access only</td><td>Private scripts and directories</td><td>Low if owner is correct</td></tr><tr><td><code>710</code></td><td><code>rwx--x---</code></td><td>Owner full, group execute</td><td>Directory traversal for group</td><td>Medium</td></tr><tr><td><code>750</code></td><td><code>rwxr-x---</code></td><td>Owner full, group read/execute</td><td>Service directories</td><td>Medium if group is broad</td></tr><tr><td><code>755</code></td><td><code>rwxr-xr-x</code></td><td>Owner write, everyone read/execute</td><td>Common binaries and web dirs</td><td>High if writable owner is compromised</td></tr><tr><td><code>770</code></td><td><code>rwxrwx---</code></td><td>Owner/group full access</td><td>Shared admin dirs</td><td>High if group is abusable</td></tr><tr><td><code>775</code></td><td><code>rwxrwxr-x</code></td><td>Owner/group write, everyone read/execute</td><td>Shared web directories</td><td>High for code paths</td></tr><tr><td><code>777</code></td><td><code>rwxrwxrwx</code></td><td>Everyone full access</td><td>Temporary lab files only</td><td>Critical on scripts, dirs, services, web roots</td></tr><tr><td><code>1733</code></td><td><code>rwx-wx-wt</code></td><td>Sticky world-writable directory</td><td>Upload/drop directories</td><td>Medium</td></tr><tr><td><code>1777</code></td><td><code>rwxrwxrwt</code></td><td>World-writable sticky directory</td><td><code>/tmp</code></td><td>Medium; check symlink/race issues</td></tr><tr><td><code>2755</code></td><td><code>rwxr-sr-x</code></td><td>SGID executable</td><td>Run with file group</td><td>High if binary/script is abusable</td></tr><tr><td><code>2775</code></td><td><code>rwxrwsr-x</code></td><td>SGID group-writable directory</td><td>Shared project dirs</td><td>High if group controls executed files</td></tr><tr><td><code>4755</code></td><td><code>rwsr-xr-x</code></td><td>SUID executable</td><td>Runs as file owner</td><td>Critical if owned by root and exploitable</td></tr><tr><td><code>4777</code></td><td><code>rwsrwxrwx</code></td><td>SUID plus world writable</td><td>Severe misconfiguration</td><td>Critical</td></tr><tr><td><code>6755</code></td><td><code>rwsr-sr-x</code></td><td>SUID and SGID executable</td><td>Privileged helper</td><td>Critical if user-controlled behavior exists</td></tr></tbody></table>

## Digit Calculator

| Value | Permission | Symbol |
| ----- | ---------- | ------ |
| 4     | Read       | `r`    |
| 2     | Write      | `w`    |
| 1     | Execute    | `x`    |
| 0     | None       | `-`    |

Add the values for each class:

| Octal Digit | Symbolic | Meaning              |
| ----------- | -------- | -------------------- |
| `0`         | `---`    | No access            |
| `1`         | `--x`    | Execute only         |
| `2`         | `-w-`    | Write only           |
| `3`         | `-wx`    | Write and execute    |
| `4`         | `r--`    | Read only            |
| `5`         | `r-x`    | Read and execute     |
| `6`         | `rw-`    | Read and write       |
| `7`         | `rwx`    | Read, write, execute |

## Special Bits

| Octal Prefix | Bit        | File Meaning            | Directory Meaning                                    |
| ------------ | ---------- | ----------------------- | ---------------------------------------------------- |
| `1`          | Sticky bit | Rare on files           | Users can delete only their own files                |
| `2`          | SGID       | Execute with file group | New files inherit directory group                    |
| `4`          | SUID       | Execute with file owner | Not meaningful for directories on most Linux systems |

## Quick Commands

```bash
stat -c '%A %a %U %G %n' /path/to/file
find / -perm -4000 -type f 2>/dev/null
find / -perm -2000 -type f 2>/dev/null
find / -writable -type d 2>/dev/null
find / -writable -type f 2>/dev/null
```

## Triage Rules

| Finding                                              | Priority |
| ---------------------------------------------------- | -------- |
| Root-owned SUID binary with unusual name or path     | Critical |
| World-writable root-executed script                  | Critical |
| Writable service file or systemd unit                | Critical |
| Writable cron target                                 | Critical |
| World-writable web root                              | High     |
| Group-writable file owned by privileged group        | High     |
| Readable secrets, backups, keys, or database configs | High     |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/privesc/permissions/linux-permissions-calculator.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
