クラウドで仮想マシンを実行しようとしたことのある人なら誰でも、標準の RDP ポートを開いたままにしておくと、世界中のさまざまな IP アドレスからのパスワード ブルート フォース攻撃の波によってほぼ即座に攻撃を受けることをよく知っています。
この記事ではその方法を紹介します
Quest InTrust では、ルールがトリガーされたときの応答アクションを設定できます。 InTrust は、ログ収集エージェントから、ワークステーションまたはサーバでの認証試行の失敗に関するメッセージを受信します。 ファイアウォールに新しい IP アドレスを追加するように構成するには、失敗した複数の承認を検出するための既存のカスタム ルールをコピーし、そのコピーを開いて編集する必要があります。
Windows ログのイベントでは、InsertionString と呼ばれるものが使用されます。
イベント 4625 のテキストは次のようになります。
An account failed to log on.
Subject:
Security ID: S-1-5-21-1135140816-2109348461-2107143693-500
Account Name: ALebovsky
Account Domain: LOGISTICS
Logon ID: 0x2a88a
Logon Type: 2
Account For Which Logon Failed:
Security ID: S-1-0-0
Account Name: Paul
Account Domain: LOGISTICS
Failure Information:
Failure Reason: Account locked out.
Status: 0xc0000234
Sub Status: 0x0
Process Information:
Caller Process ID: 0x3f8
Caller Process Name: C:WindowsSystem32svchost.exe
Network Information:
Workstation Name: DCC1
Source Network Address: ::1
Source Port: 0
Detailed Authentication Information:
Logon Process: seclogo
Authentication Package: Negotiate
Transited Services: -
Package Name (NTLM only): -
Key Length: 0
This event is generated when a logon request fails. It is generated on the computer where access was attempted.
The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.
The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).
The Process Information fields indicate which account and process on the system requested the logon.
The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
さらに、ソース ネットワーク アドレスの値をイベント テキストに追加します。
次に、Windows ファイアウォールで IP アドレスをブロックするスクリプトを追加する必要があります。 以下はこれに使用できる例です。
ファイアウォールを設定するためのスクリプト
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$SourceAddress
)
$SourceAddress = $SourceAddress.Trim()
$ErrorActionPreference = 'Stop'
$ruleName = 'Quest-InTrust-Block-Failed-Logons'
$ruleDisplayName = 'Quest InTrust: Blocks IP addresses from failed logons'
function Get-BlockedIps {
(Get-NetFirewallRule -Name $ruleName -ErrorAction SilentlyContinue | get-netfirewalladdressfilter).RemoteAddress
}
$blockedIps = Get-BlockedIps
$allIps = [array]$SourceAddress + [array]$blockedIps | Select-Object -Unique | Sort-Object
if (Get-NetFirewallRule -Name $ruleName -ErrorAction SilentlyContinue) {
Set-NetFirewallRule -Name $ruleName -RemoteAddress $allIps
} else {
New-NetFirewallRule -Name $ruleName -DisplayName $ruleDisplayName -Direction Inbound -Action Block -RemoteAddress $allIps
}
後で混乱を避けるために、ルール名と説明を変更できるようになりました。
ここで、このスクリプトを応答アクションとしてルールに追加し、ルールを有効にして、対応するルールがリアルタイム監視ポリシーで有効になっていることを確認する必要があります。 エージェントは応答スクリプトを実行できるようにする必要があり、正しいパラメータが指定されている必要があります。
設定完了後は、認証失敗が80%減少しました。 利益? なんと素晴らしいことでしょう!
場合によっては再びわずかな増加が発生しますが、これは新しい攻撃源の出現によるものです。 その後、すべてが再び衰退し始めます。
66 週間の作業を通じて、XNUMX 個の IP アドレスがファイアウォール ルールに追加されました。
以下の表は、認証の試行に使用された 10 個の一般的なユーザー名を示しています。
ユーザー名
数
パーセンテージで
管理者
1220235
40.78
管理人
672109
22.46
user
219870
7.35
コントソ
126088
4.21
contoso.com
73048
2.44
管理者
55319
1.85
39403
1.32
sgazlabdc01.contoso.com
32177
1.08
administrateur
32377
1.08
sgazlabdc01
31259
1.04
情報セキュリティの脅威にどのように対応しているかをコメントで教えてください。 どのようなシステムを利用しており、どの程度便利ですか?
InTrust の実際の動作に興味がある場合は、
情報セキュリティに関する他の記事をお読みください。