> 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/ja/privesc/permissions/linux-permissions-calculator.md).

# Linux 権限計算機

8 進数とシンボリック表記、SUID、SGID、sticky bit、一般的なモード、権限昇格のトリアージ用の Linux 権限計算機。

次のような8進モードを検索する `755`, `644`, `600`, `4755`、または次のようなシンボリックモードを検索する `rwxr-xr-x` 権限を変換し、影響を理解するために。

## 権限ファインダー

<table data-view="cards" data-full-width="true" data-search="true"><thead><tr><th>8進数</th><th>シンボリック</th><th>意味</th><th>典型的な用途</th><th>権限昇格リスク</th></tr></thead><tbody><tr><td><code>000</code></td><td><code>---------</code></td><td>権限なし</td><td>ロックされたファイル</td><td>低</td></tr><tr><td><code>400</code></td><td><code>r--------</code></td><td>所有者のみ読み取り</td><td>秘密鍵の中身</td><td>誤った所有者が読み取れるなら高</td></tr><tr><td><code>600</code></td><td><code>rw-------</code></td><td>所有者のみ読み書き</td><td>SSHキー、設定ファイル、機密情報</td><td>所有者がサービスアカウントなら中</td></tr><tr><td><code>640</code></td><td><code>rw-r-----</code></td><td>所有者読み書き、グループ読み取り</td><td>共有サービス設定</td><td>グループが機密情報を公開できるなら高</td></tr><tr><td><code>644</code></td><td><code>rw-r--r--</code></td><td>所有者書き込み、全員読み取り</td><td>公開Webファイル</td><td>機密ファイルでは高</td></tr><tr><td><code>660</code></td><td><code>rw-rw----</code></td><td>所有者/グループ読み書き</td><td>チーム管理ファイル</td><td>グループが特権スクリプトを編集できるなら高</td></tr><tr><td><code>664</code></td><td><code>rw-rw-r--</code></td><td>所有者/グループ書き込み、全員読み取り</td><td>共同作業ファイル</td><td>中〜高</td></tr><tr><td><code>666</code></td><td><code>rw-rw-rw-</code></td><td>全員読み書き</td><td>めったに適切ではない</td><td>設定、スクリプト、認証ファイルでは重大</td></tr><tr><td><code>700</code></td><td><code>rwx------</code></td><td>所有者のみフルアクセス</td><td>非公開スクリプトとディレクトリ</td><td>所有者が正しいなら低</td></tr><tr><td><code>710</code></td><td><code>rwx--x---</code></td><td>所有者フル、グループ実行</td><td>グループのディレクトリ移動用</td><td>中</td></tr><tr><td><code>750</code></td><td><code>rwxr-x---</code></td><td>所有者フル、グループ読み取り/実行</td><td>サービスディレクトリ</td><td>グループが広範なら中</td></tr><tr><td><code>755</code></td><td><code>rwxr-xr-x</code></td><td>所有者書き込み、全員読み取り/実行</td><td>一般的なバイナリとWebディレクトリ</td><td>書き込み可能な所有者が侵害されると高</td></tr><tr><td><code>770</code></td><td><code>rwxrwx---</code></td><td>所有者/グループフルアクセス</td><td>共有管理ディレクトリ</td><td>グループが悪用可能なら高</td></tr><tr><td><code>775</code></td><td><code>rwxrwxr-x</code></td><td>所有者/グループ書き込み、全員読み取り/実行</td><td>共有Webディレクトリ</td><td>コードパスでは高</td></tr><tr><td><code>777</code></td><td><code>rwxrwxrwx</code></td><td>全員フルアクセス</td><td>一時的な実験用ファイルのみ</td><td>スクリプト、ディレクトリ、サービス、Webルートでは重大</td></tr><tr><td><code>1733</code></td><td><code>rwx-wx-wt</code></td><td>スティッキー付きの全員書き込み可能ディレクトリ</td><td>アップロード/ドロップ用ディレクトリ</td><td>中</td></tr><tr><td><code>1777</code></td><td><code>rwxrwxrwt</code></td><td>全員書き込み可能なスティッキー付きディレクトリ</td><td><code>/tmp</code></td><td>中。シンボリックリンク/競合状態の問題を確認</td></tr><tr><td><code>2755</code></td><td><code>rwxr-sr-x</code></td><td>SGID実行ファイル</td><td>ファイルのグループで実行</td><td>バイナリ/スクリプトが悪用可能なら高</td></tr><tr><td><code>2775</code></td><td><code>rwxrwsr-x</code></td><td>SGIDのグループ書き込み可能ディレクトリ</td><td>共有プロジェクトディレクトリ</td><td>グループが実行されるファイルを管理しているなら高</td></tr><tr><td><code>4755</code></td><td><code>rwsr-xr-x</code></td><td>SUID実行ファイル</td><td>ファイル所有者として実行</td><td>root所有で悪用可能なら重大</td></tr><tr><td><code>4777</code></td><td><code>rwsrwxrwx</code></td><td>SUIDに加えて全員書き込み可能</td><td>深刻な設定ミス</td><td>重大</td></tr><tr><td><code>6755</code></td><td><code>rwsr-sr-x</code></td><td>SUIDおよびSGID実行ファイル</td><td>特権ヘルパー</td><td>ユーザー制御可能な動作がある場合は重大</td></tr></tbody></table>

## 数値計算機

| 値 | 権限   | 記号  |
| - | ---- | --- |
| 4 | 読み取り | `r` |
| 2 | 書き込み | `w` |
| 1 | 実行   | `x` |
| 0 | なし   | `-` |

各クラスの値を加算する:

| 8進桁 | シンボリック | 意味           |
| --- | ------ | ------------ |
| `0` | `---`  | アクセスなし       |
| `1` | `--x`  | 実行のみ         |
| `2` | `-w-`  | 書き込みのみ       |
| `3` | `-wx`  | 書き込みと実行      |
| `4` | `r--`  | 読み取りのみ       |
| `5` | `r-x`  | 読み取りと実行      |
| `6` | `rw-`  | 読み取りと書き込み    |
| `7` | `rwx`  | 読み取り、書き込み、実行 |

## 特殊ビット

| 8進接頭辞 | ビット       | ファイルでの意味     | ディレクトリでの意味                    |
| ----- | --------- | ------------ | ----------------------------- |
| `1`   | スティッキービット | ファイルではまれ     | ユーザーは自分のファイルしか削除できない          |
| `2`   | SGID      | ファイルのグループで実行 | 新しいファイルはディレクトリのグループを継承する      |
| `4`   | SUID      | ファイル所有者として実行 | ほとんどのLinuxシステムではディレクトリには意味がない |

## クイックコマンド

```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
```

## 優先度判定ルール

| 検出項目                              | 優先度 |
| --------------------------------- | --- |
| 不審な名前またはパスを持つroot所有のSUIDバイナリ      | 重大  |
| rootが実行する全員書き込み可能なスクリプト           | 重大  |
| 書き込み可能なサービスファイルまたはsystemdユニット     | 重大  |
| 書き込み可能なcron対象                     | 重大  |
| 全員書き込み可能なWebルート                   | 高   |
| 特権グループ所有のグループ書き込み可能ファイル           | 高   |
| 読み取り可能な機密情報、バックアップ、キー、またはデータベース設定 | 高   |


---

# 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/ja/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.
