Microsoft Defender for Endpointはマルウェア対策スキャン インターフェイス (AMSI) を利用して、ファイルレスマルウェア、動的スクリプトベースの攻撃、およびその他の非伝統的なサイバー脅威に対する保護を強化します。 この記事では、良性のサンプルを使用して AMSI エンジンをテストする方法について説明します。
Prerequsites
- Microsoft Defenderウイルス対策 (プライマリ) とこれらの機能を有効にする必要があります。
- Real-Time Protection (RTP)
- 動作監視 (BM)
- スクリプト スキャンを有効にする
サポートされるオペレーティング システム
- Windows 10 以降
- Windows Server 2016 以降
Defender for Endpoint を使用した AMSI のテスト
このデモ記事では、AMSI をテストするための 2 つのエンジンの選択肢があります。
- PowerShell
- VBScript
PowerShell を使用して AMSI をテストする
次の PowerShell スクリプトを
AMSI_PoSh_script.ps1として保存します。$testString = "AMSI Test Sample: " + "7e72c3ce-861b-4339-8740-0ac1484c1386" Invoke-Expression $testString ```powershellデバイスで、管理者として PowerShell を開きます。
「
Powershell -ExecutionPolicy Bypass AMSI_PoSh_script.ps1」と入力して、Enter キーを押します。結果は次のようになります。
Invoke-Expression : At line:1 char:1 + AMSI Test Sample: 7e72c3ce-861b-4339-8740-8ac1484c1386 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This script contains malicious content and has been blocked by your antivirus software. At C:\Users\Admin\Desktop\AMSI_PoSh_script.ps1:3 char:1 + Invoke-Expression $testString + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException + FullyQualifiedErrorId : ScriptContainedMaliciousContent,Microsoft.PowerShell.Commands.InvokeExpressionCommand ```
VBScript を使用した AMSI のテスト
次の VBScript を
AMSI_vbscript.vbsとして保存します。REM Save this sample AMSI vbscript as AMSI_vbscript.vbs Dim result result = eval("AMSI Test Sample: " + "7e72c3ce-861b-4339-8740-0ac1484c1386") WScript.Echo resultWindows デバイスで、管理者としてコマンド プロンプトを開きます。
「
wscript AMSI_vbscript.vbs」と入力して、Enter キーを押します。結果は次のようになります。
Windows Script Host Script: C:\Users\Admin\Desktop\AMSI_vbscript.vbs Line: 3 Char: 1 Error: This script contains malicious content and has been blocked by your antivirus software.: 'eval' Code: 800A802D Source: Microsoft VBScript runtime error
テスト結果の確認
保護履歴には、次の情報が表示されます。
Threat blocked
Detected: Virus: Win32/MpTest!amsi
Status: Cleaned
This threat or app was cleaned or quarantined before it became active on your device.
Details: This program is dangerous and replicates by infecting other files.
Affected items:
amsi: \Device\HarddiskVolume3\Windows\System32\WindowsPowershell\v1.0\powershell.exe
or
amsi: C:\Users\Admin\Desktop\AMSI_vbscript.vbs
and/or you might see:
Threat blocked
Detected: Virus: Win32/MpTest!amsi
Status: Cleaned
This threat or app was cleaned or quarantined before it became active on your device.
Details: This program is dangerous and replicates by infecting other files
Microsoft Defenderウイルス対策の脅威の一覧を取得する
検出された脅威は、イベント ログまたは PowerShell を使用して表示できます。
イベント ログを使用する
[スタート] に移動し、
EventVwr.mscを検索します。 結果の一覧でイベント ビューアーを開きます。[アプリケーションとサービス のログ>Microsoft>Windows>Windows Defender の運用イベント] に移動します。
event ID 1116を探します。 次の情報が表示されます。Microsoft Defender Antivirus has detected malware or other potentially unwanted software. For more information please see the following: https://go.microsoft.com/fwlink/?linkid=37020&name=Virus:Win32/MpTest!amsi&t Name: Virus:Win32/MpTest!amsi ID: 2147694217 Severity: Severe Category: Virus Path: \Device\HarddiskVolume3\Windows\System32\WindowsPowerShell\v1.0\powershell.exe or C:\Users\Admin\Desktop\AMSI_jscri Detection Origin: Local machine or Unknown Detection Type: Concrete Detection Source: System User: NT AUTHORITY\SYSTEM Process Name: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe or C:\Windows\System32\cscript.exe or C:\Windows\Sy Security intelligence Version: AV: 1.419.221.0, AS: 1.419.221.0, NIS: 1.419.221.0 Engine Version: AM: 1.1.24080.9, NIS: 1.1.24080.9
PowerShell を使う
デバイスで PowerShell を開きます。
次のコマンドを入力します:
Get-MpThreat。次の結果が表示される場合があります。
CategoryID : 42 DidThreatExecute : True IsActive : True Resources : RollupStatus : 97 SchemaVersion : 1.0.0.0 SeverityID : 5 ThreatID : 2147694217 ThreatName : Virus:Win32/MpTest!amsi TypeID : 0 PSComputerName :
関連項目
Microsoft Defender for Endpoint - デモンストレーション シナリオ
ヒント
さらに多くの情報を得るには、 Tech Community 内の Microsoft Security コミュニティ (Microsoft Defender for Endpoint Tech Community) にご参加ください。