SOC Prime Bias: 危機

22 May 2026 07:08 UTC

公開されたRDP:攻撃者にとって依然として有利な設定ミス

Author Photo
SOC Prime Team linkedin icon フォローする
公開されたRDP:攻撃者にとって依然として有利な設定ミス
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

概要

この記事では、公開されたリモートデスクトッププロトコル(RDP)サービスが引き続き攻撃者にとって一般的な初期アクセスベクターとして機能していることを説明しています。多くの組織は依然としてRDPポートをインターネットからアクセス可能な状態にしており、自動スキャンや機会を狙った侵入攻撃の容易なターゲットになっています。この投稿は、攻撃者がオープンRDPアクセスや公開されたRDWebポータルを悪用して環境に侵入し、その後、横方向への移動を通じてアクセスを拡大する実例を紹介します。

調査

説明されているケースには、インターネットに露出したRDPポートを持つ医療組織、RDWebポータルを通じた妥協を伴う事件、攻撃者が脆弱なSonicWall VPNデバイスを悪用した後にRDPを有効にするためにファイアウォールとレジストリ設定を変更した侵入が含まれています。これらのシナリオでは、攻撃者は単純なWindowsコマンド、リバーストンネルユーティリティ、および資格情報収集スクリプトに依存してアクセスを維持し、ネットワーク内でさらに深く移動しました。

緩和策

推奨される防御策は、不必要なRDPの露出を排除し、必要なRDPアクセスを適切に設定されたファイアウォールの背後に置き、疑わしい露出の後に資格情報をローテーションし、ファイアウォールおよびVPNログをSIEMに投入してより迅速に検出することに焦点を当てています。また、EDRカバレッジを展開し、RDPサービスを有効または再有効にするレジストリ変更を監視することも勧めています。

対応

疑わしいRDP関連の活動が検出された場合、対応者は問題のIPアドレスをブロックし、RDPサービスを無効にし、悪意のあるレジストリ変更を元に戻し、ファイアウォールルールが変更されていないことを確認し、影響を受けた資格情報をリセットする必要があります。繰り返しアクセスしようとする試みの監視と、すべての設定変更の検証も不可欠です。

<div class="wp-block-socprime-category-attack-flow attack-flow-class" data-title="Attack Flow" data-attack-flow="graph TB %% Class Definitions classDef technique fill:#ffcc99 classDef action fill:#99ccff classDef tool fill:#cccccc classDef operator fill:#ff9900 %% Nodes – Techniques tech_scanning_ip["<b>Technique</b> – <b>T1595.001</b><br/><b>Name</b>: Active Scanning: Scanning IP Blocks<br/><b>Description</b>: Adversary probes ranges of IP addresses to locate vulnerable hosts."] class tech_scanning_ip technique tech_scanning_vuln["<b>Technique</b> – <b>T1595.002</b><br/><b>Name</b>: Active Scanning: Vulnerability Scanning<br/><b>Description</b>: Uses automated tools to find known vulnerabilities in remote systems."] class tech_scanning_vuln technique tech_valid_accounts["<b>Technique</b> – <b>T1078</b><br/><b>Name</b>: Valid Accounts<br/><b>Description</b>: Use of stolen or otherwise compromised credentials to gain access."] class tech_valid_accounts technique tech_disable_firewall["<b>Technique</b> – <b>T1562.004</b><br/><b>Name</b>: Disable or Modify System Firewall<br/><b>Description</b>: Alters firewall configuration to allow inbound traffic such as RDP."] class tech_disable_firewall technique tech_create_modify_process["<b>Technique</b> – <b>T1543</b><br/><b>Name</b>: Create or Modify System Process<br/><b>Description</b>: Creates or changes system processes via registry or service configuration."] class tech_create_modify_process technique tech_system_services["<b>Technique</b> – <b>T1569</b><br/><b>Name</b>: System Services<br/><b>Description</b>: Manipulates services to execute malicious code or maintain persistence."] class tech_system_services technique tech_discovery_network["<b>Technique</b> – <b>T1049</b><br/><b>Name</b>: System Network Connections Discovery<br/><b>Description</b>: Enumerates active network connections on the compromised host."] class tech_discovery_network technique %% Nodes – Tools / Commands tool_shodan["<b>Tool</b> – <b>Name</b>: Shodan<br/><b>Description</b>: Internet‑wide scanning service used to discover exposed services such as RDP."] class tool_shodan tool tool_rdp["<b>Tool</b> – <b>Name</b>: Remote Desktop Protocol (RDP)<br/><b>Description</b>: Windows remote login service leveraged after credential theft."] class tool_rdp tool tool_netsh["<b>Tool</b> – <b>Name</b>: netsh<br/><b>Command</b>: netsh advfirewall add rule name='RDP-Open' dir=in protocol=TCP localport=3389 action=allow enable=yes"] class tool_netsh tool tool_reg["<b>Tool</b> – <b>Name</b>: reg.exe<br/><b>Command</b>: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f"] class tool_reg tool tool_netstart["<b>Tool</b> – <b>Name</b>: net start<br/><b>Command</b>: net start TermService"] class tool_netstart tool tool_adv_ip_scanner["<b>Tool</b> – <b>Name</b>: Advanced IP Scanner<br/><b>Description

graph TB %% Class Definitions classDef technique fill:#ffcc99 classDef action fill:#99ccff classDef tool fill:#cccccc classDef operator fill:#ff9900 %% Nodes – Techniques tech_scanning_ip[“<b>技術</b> – <b>T1595.001</b><br/><b>名称</b>: アクティブスキャン: IPブロックのスキャン<br/><b>説明</b>: 敵対者が脆弱なホストを特定するためにIPアドレス範囲を調べます。”] class tech_scanning_ip technique tech_scanning_vuln[“<b>技術</b> – <b>T1595.002</b><br/><b>名称</b>: アクティブスキャン: 脆弱性スキャン<br/><b>説明</b>: 自動化ツールを使用してリモートシステムの既知の脆弱性を検出します。”] class tech_scanning_vuln technique tech_valid_accounts[“<b>技術</b> – <b>T1078</b><br/><b>名称</b>: 有効なアカウント<br/><b>説明</b>: 盗まれたまたは他の方法で妥協された資格情報を使用してアクセスを得ます。”] class tech_valid_accounts technique tech_disable_firewall[“<b>技術</b> – <b>T1562.004</b><br/><b>名称</b>: システムファイアウォールの無効化または変更<br/><b>説明</b>: インバウンドトラフィック(例:RDP)を許可するためにファイアウォール設定を変更します。”] class tech_disable_firewall technique tech_create_modify_process[“<b>技術</b> – <b>T1543</b><br/><b>名称</b>: システムプロセスの作成または変更<br/><b>説明</b>: レジストリまたはサービス設定を介してシステムプロセスを作成または変更します。”] class tech_create_modify_process technique tech_system_services[“<b>技術</b> – <b>T1569</b><br/><b>名称</b>: システムサービス<br/><b>説明</b>: サービスを操作して悪意のあるコードを実行するか、持続性を維持します。”] class tech_system_services technique tech_discovery_network[“<b>技術</b> – <b>T1049</b><br/><b>名称</b>: システムネットワーク接続の発見<br/><b>説明</b>: 妥協したホスト上でアクティブなネットワーク接続を列挙します。”] class tech_discovery_network technique %% Nodes – Tools / Commands tool_shodan[“<b>ツール</b> – <b>名称</b>: Shodan<br/><b>説明</b>: RDPのような公開されたサービスを発見するために使用されるインターネット全体のスキャンサービス。”] class tool_shodan tool tool_rdp[“<b>ツール</b> – <b>名称</b>: リモートデスクトッププロトコル (RDP)<br/><b>説明</b>: 資格情報の盗難後に活用されるWindowsのリモートログインサービス。”] class tool_rdp tool tool_netsh[“<b>ツール</b> – <b>名称</b>: netsh<br/><b>コマンド</b>: netsh advfirewall add rule name=’RDP-Open’ dir=in protocol=TCP localport=3389 action=allow enable=yes”] class tool_netsh tool tool_reg[“<b>ツール</b> – <b>名称</b>: reg.exe<br/><b>コマンド</b>: reg add “HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f”] class tool_reg tool tool_netstart[“<b>ツール</b> – <b>名称</b>: net start<br/><b>コマンド</b>: net start TermService”] class tool_netstart tool tool_adv_ip_scanner[“<b>ツール</b> – <b>名称</b>: Advanced IP Scanner<br/><b>説明</b>: デバイスおよびネットワーク接続を列挙するために使用されるGUIユーティリティ。”] class tool_adv_ip_scanner tool %% Connections – Attack Flow tech_scanning_ip –>|uses| tool_shodan tech_scanning_ip –>|leads_to| tech_scanning_vuln tech_scanning_vuln –>|leads_to| tech_valid_accounts tech_valid_accounts –>|uses| tool_rdp tool_rdp –>|enables| tech_disable_firewall tech_disable_firewall –>|uses| tool_netsh tech_disable_firewall –>|leads_to| tech_create_modify_process tech_create_modify_process –>|uses| tool_reg tech_create_modify_process –>|leads_to| tech_system_services tech_system_services –>|uses| tool_netstart tech_valid_accounts –>|reused_for| tech_valid_accounts tech_valid_accounts –>|leads_to| tech_discovery_network tech_discovery_network –>|uses| tool_adv_ip_scanner

攻撃フロー

シミュレーション実行

前提条件: テレメトリおよびベースラインのプリフライトチェックが合格している必要があります。

根拠: このセクションでは、検出ルールをトリガーするために設計された敵対者の技術(TTP)の正確な実行を詳細に説明します。 コマンドおよびナarr atorが識別されたTTPに直接的に反映され、検出ロジックによって期待される正確なテレメトリーを生成することを目的としています。

  • 攻撃の説明およびコマンド:

    1. 偵察 (T1016.001): 敵対者は、ターゲットサブネットのポート3389が開いているホストを特定するために Test-NetConnection をループで実行します。
    2. 特権昇格/ファイアウォール操作 (T1021.001): ローカル管理者権限を取得した攻撃者は、 netsh.exe を使用して、RDPのために許可するインバウンドファイアウォールルールを追加し、サービスをインターネットに露出させました。
    3. 作成後の検証: 攻撃者はファイアウォールルールをリストして、新しいエントリが存在することを確認し、その後、RDPセッションを開始します(このテストの範囲外)。
  • 回帰テストスクリプト:

    #---------------------------------------------------------
    # シミュレートされた敵対者の活動 – RDPがnetsh経由で公開されている場合
    #---------------------------------------------------------
    # 1. 開いているRDPポートの探索のためにローカル/24サブネットをスキャンします(無害の再評定)
    $subnet = "10.0.0."
    1..254 | ForEach-Object {
        $ip = "$subnet$_"
        $result = Test-NetConnection -ComputerName $ip -Port 3389 -WarningAction SilentlyContinue
        if ($result.TcpTestSucceeded) {
            Write-Host "[+] RDPが $ip に開いています"
        }
    }
    
    # 2. 任意のアドレスからのインバウンドRDPを許可するファイアウォールルールを追加
    $ruleName = "TempAllowRDP_$(Get-Random -Maximum 10000)"
    $netshCmd = "advfirewall firewall add rule name=`"$ruleName`" dir=in action=allow protocol=TCP localport=3389"
    Write-Host "`n[+] netshでファイアウォールルールを作成しています..."
    Start-Process -FilePath "$env:SystemRootSystem32netsh.exe" -ArgumentList $netshCmd -Wait -NoNewWindow
    
    # 3. ルールが存在するか確認(オプション、テレメトリーの確認に役立つ)
    netsh advfirewall firewall show rule name=$ruleName
    
    # シミュレートされた攻撃の終わり
  • クリーンアップコマンド:

    #---------------------------------------------------------
    # テスト中に作成された一時的なファイアウォールルールを削除
    #---------------------------------------------------------
    $rulePrefix = "TempAllowRDP_"
    $rules = netsh advfirewall firewall show rule name=all |
             Select-String -Pattern $rulePrefix |
             ForEach-Object { ($_ -split 's+')[0] }
    
    foreach ($r in $rules) {
        Write-Host "[*] ルール $r を削除しています"
        netsh advfirewall firewall delete rule name=$r
    }