다음을 통해 공유


엔드포인트용 Microsoft Defender 사용하는 AMSI 데모

엔드포인트용 Microsoft Defender AMSI(Antimalware Scan Interface)를 활용하여 파일리스 맬웨어, 동적 스크립트 기반 공격 및 기타 비전통적 사이버 위협에 대한 보호를 강화합니다. 이 문서에서는 양성 샘플로 AMSI 엔진을 테스트하는 방법을 설명합니다.

시나리오 요구 사항 및 설정

  • Windows 10 이상
  • Windows Server 2016 이상
  • Microsoft Defender 바이러스 백신(기본) 및 이러한 기능을 사용하도록 설정해야 합니다.
    • RTP(Real-Time Protection)
    • BM(동작 모니터링)
    • 스크립트 검사 켜기

엔드포인트용 Defender를 사용하여 AMSI 테스트

이 데모 문서에서는 AMSI를 테스트하기 위해 다음 두 가지 엔진을 선택할 수 있습니다.

  • PowerShell
  • VBScript

PowerShell을 사용하여 AMSI 테스트

  1. 다음 PowerShell 스크립트를 로 AMSI_PoSh_script.ps1저장합니다.

    $testString = "AMSI Test Sample: " + "7e72c3ce-861b-4339-8740-0ac1484c1386"
    Invoke-Expression $testString
    ```powershell
    
    
  2. 디바이스에서 관리자 권한으로 PowerShell을 엽니다.

  3. 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 테스트

  1. 다음 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 result
    
  2. Windows 디바이스에서 관리자 권한으로 명령 프롬프트를 엽니다.

  3. 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을 사용하여 검색된 위협을 볼 수 있습니다.

이벤트 로그 사용

  1. 시작으로 이동하여 를 검색합니다EventVwr.msc. 결과 목록에서 이벤트 뷰어 엽니다.

  2. 애플리케이션 및 서비스 로그>Microsoft>Windows Windows>Defender 운영 이벤트로 이동합니다.

  3. 를 찾습니다 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 사용

  1. 디바이스에서 PowerShell을 엽니다.

  2. 명령을 입력합니다 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 - 데모 시나리오

더 자세히 알아보고 싶으신가요? 기술 커뮤니티: 엔드포인트용 Microsoft Defender Tech Community의 Microsoft 보안 커뮤니티와 Engage.