Testare avvisi di analisi malware senza agente

Oltre alla protezione antimalware di nuova generazione fornita dall'integrazione basata su agente di Defender for Endpoint con Defender per il cloud, Defender for Servers Piano 2 offre l'analisi malware senza agente come parte delle sue funzionalità di analisi senza agente.

Questo articolo descrive come creare un avviso di test per assicurarsi che l'analisi di malware senza agente funzioni come previsto.

Prerequisiti

  • Defender per server piano 2 è attivato.
  • La scansione senza agente è abilitata nel piano.

Creare un file di test per Linux

Usa i seguenti passaggi per creare un file di test su una VM Linux e attivare un avviso di scansione malware senza agenti.

  1. Aprire una finestra del terminale nella macchina virtuale.

  2. Esegui il seguente script per creare e validare un file di test che contiene la stringa di test antivirus:

    # test string  
    TEST_STRING='$$89-barbados-dublin-damascus-notice-pulled-natural-31$$'  
    
    # File to be created  
    FILE_PATH="/tmp/virus_test_file.txt"  
    
    # Write the test string to the file  
    echo -n $TEST_STRING > $FILE_PATH  
    
    # Check if the file was created and contains the correct string  
    if [ -f "$FILE_PATH" ]; then  
        if grep -Fq "$TEST_STRING" "$FILE_PATH"; then  
            echo "Virus test file created and validated successfully."  
        else  
            echo "Virus test file does not contain the correct string."  
        fi  
    else  
        echo "Failed to create virus test file."  
    fi
    

L'avviso MDC_Test_File malware was detected (Agentless) verrà visualizzato entro 24 ore nella pagina avvisi di Defender per il cloud e nel portale di Defender XDR.

Screenshot dell'avviso di test visualizzato in Defender per il cloud per Linux.

Creare un file di test per Windows con un documento di testo

Usa i seguenti passaggi per creare un file di testo Windows che attivi un avviso di test per la scansione del malware senza agente.

  1. Creare un file di testo nella macchina virtuale.

  2. Incollare il testo $$89-barbados-dublin-damascus-notice-pulled-natural-31$$ nel file di testo. Assicurarsi che nel file di testo non siano presenti spazi o righe aggiuntivi.

  3. Salva il file.

  4. Apri il file per verificare che contiene la stringa di test incollata.

L'avviso MDC_Test_File malware was detected (Agentless) verrà visualizzato entro 24 ore nella pagina avvisi di Defender per il cloud e nel portale di Defender XDR.

Screenshot dell'avviso di test visualizzato in Defender per il cloud per Windows a causa del file di testo creato.

Creare un file di test per Windows con PowerShell

Usa i seguenti passaggi di PowerShell per creare un file di test Windows e generare un avviso di test di scansione malware.

  1. Aprire PowerShell nella macchina virtuale.

  2. Eseguire lo script seguente.

# Virus test string
$TEST_STRING = '$$89-barbados-dublin-damascus-notice-pulled-natural-31$$'

# File to be created
$FILE_PATH = "C:\temp\virus_test_file.txt"

# Create "temp" directory if it does not exist
$DIR_PATH = "C:\temp"
if (!(Test-Path -Path $DIR_PATH)) {
   New-Item -ItemType Directory -Path $DIR_PATH
}

# Write the test string to the file without a trailing newline
[IO.File]::WriteAllText($FILE_PATH, $TEST_STRING)

# Check if the file was created and contains the correct string
if (Test-Path -Path $FILE_PATH) {
    $content = [IO.File]::ReadAllText($FILE_PATH)
    if ($content -eq $TEST_STRING) {
      Write-Host "Test file created and validated successfully."
    } else {
       Write-Host "Test file does not contain the correct string."
    }
} else {
    Write-Host "Failed to create test file."
}

L'avviso MDC_Test_File malware was detected (Agentless) verrà visualizzato entro 24 ore nella pagina avvisi di Defender per il cloud e nel portale di Defender XDR.

Screenshot dell'avviso di test che appare in Defender per il cloud per Windows a causa dello script di PowerShell.