Condividi tramite


Dimostrazioni delle regole di riduzione della superficie di attacco

Si applica a:

Le regole di riduzione della superficie di attacco sono destinate a comportamenti specifici che in genere vengono usati da malware e app dannose per infettare i computer, ad esempio:

  • File eseguibili e script usati nelle app di Office o nella posta Web che tentano di scaricare o eseguire file
  • Script offuscati o in altro modo sospetti
  • Comportamenti che le app intraprendono che non vengono avviati durante il normale lavoro quotidiano

Requisiti e configurazione dello scenario

Comandi PowerShell

Add-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EfC-AADC-AD5F3C50688A -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536-B80A7769E899 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A917-57927947596D -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D1E49AAC-8F56-4280-B9BA-993A6D77406C -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568109D35 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 01443614-CD74-433A-B99E-2ECDC07BFC25 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 56a863a9-875e-4185-98a7-b882c64b5ce5 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids e6db77e5-3df2-4cf1-b95a-636979351e5b -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids a8f5898e-1dc8-49a9-9878-85004b8a61e6 -AttackSurfaceReductionRules_Actions Enabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 26190899-1602-49E8-8B27-EB1D0A1CE869 -AttackSurfaceReductionRules_Actions AuditMode
Add-MpPreference -AttackSurfaceReductionRules_Ids 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -AttackSurfaceReductionRules_Actions AuditMode

Stati delle regole

Stato Modalità Valore numerico
Disabilitato = Disattivato 0
Abilitato = Modalità blocco 1
Audit = Modalità di controllo 2

Verificare la configurazione


Get-MpPreference

File di test

Nota: alcuni file di test hanno più exploit incorporati e attivano più regole

Nome regola GUID regola
Bloccare il contenuto eseguibile dal client di posta elettronica e dalla webmail BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550
Impedire alle applicazioni di Office di creare processi figlio D4F940AB-401B-4EFC-AADC-AD5F3C50688A
Impedire alle applicazioni di Office di creare contenuto eseguibile 3B576869-A4EC-4529-8536-B80A7769E899
Impedire alle applicazioni di Office di eseguire l'inserimento in altri processi 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84
Impedire a JavaScript e VBScript di avviare eseguibili D3E037E1-3EB8-44C8-A917-57927947596D
Blocca l'esecuzione di script potenzialmente offuscati 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC
Bloccare le importazioni Win32 dal codice macro in Office 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B
{Blocca le creazioni di processi provenienti da PSExec & comandi WMI D1E49AAC-8F56-4280-B9BA-993A6D77406C
Blocca l'esecuzione di eseguibili non attendibili o non firmati all'interno di supporti USB rimovibili B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4
Prevenzione ransomware aggressiva C1DB55AB-C21A-4637-BB3F-A12568109D35
Blocca l'esecuzione dei file eseguibili a meno che non soddisfino criteri di prevalenza, età o elenco attendibile 01443614-CD74-433A-B99E-2ECDC07BFC25
Impedire ad Adobe Reader di creare processi figlio 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c
Bloccare l'abuso di driver firmati vulnerabili sfruttati 56a863a9-875e-4185-98a7-b882c64b5ce5
Bloccare il furto di credenziali dal sottosistema dell'autorità di sicurezza locale di Windows (lsass.exe) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2
Bloccare la persistenza tramite la sottoscrizione di eventi WMI e6db77e5-3df2-4cf1-b95a-636979351e5b
Bloccare la creazione di WebShell per i server a8f5898e-1dc8-49a9-9878-85004b8a61e6

Scenari

Configurazione

Scaricare ed eseguire questo script di installazione. Prima di eseguire i criteri di esecuzione del set di script su Senza restrizioni usando questo comando di PowerShell:

Set-ExecutionPolicy Unrestricted

È invece possibile eseguire questi passaggi manuali:

  1. Create una cartella in c: named demo, "c:\demo"
  2. Salvare questo file pulito in c:\demo.
  3. Abilitare tutte le regole usando il comando di PowerShell.

Scenario 1: la riduzione della superficie di attacco blocca un file di test con più vulnerabilità

  1. Abilitare tutte le regole in modalità blocco usando i comandi di PowerShell (è possibile copiare incolla tutto)
  2. Scaricare e aprire uno dei file/documenti di test e abilitare la modifica e il contenuto, se richiesto.

Risultati previsti dello scenario 1

Verrà visualizzata immediatamente una notifica "Azione bloccata".

Scenario 2: la regola ASR blocca il file di test con la vulnerabilità corrispondente

  1. Configurare la regola da testare usando il comando PowerShell del passaggio precedente.

    Esempio: Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EfC-AADC-AD5F3C50688A -AttackSurfaceReductionRules_Actions Enabled

  2. Scaricare e aprire il file/documento di test per la regola da testare e abilitare la modifica e il contenuto, se richiesto.

    Esempio: impedire alle applicazioni di Office di creare processi figlio D4F940AB-401B-4EFC-AADC-AD5F3C50688A

Risultati previsti dello scenario 2

Verrà visualizzata immediatamente una notifica "Azione bloccata".

Scenario 3 (Windows 10 o versioni successive): la regola ASR blocca l'esecuzione del contenuto USB non firmato

  1. Configurare la regola per la protezione USB (B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4).
Add-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -AttackSurfaceReductionRules_Actions Enabled
  1. Scaricare il file e inserirlo su una chiavetta USB ed eseguirlo Blocca l'esecuzione di eseguibili non attendibili o non firmati all'interno di supporti USB rimovibili

Risultati previsti dello scenario 3

Verrà visualizzata immediatamente una notifica "Azione bloccata".

Scenario 4: Cosa accadrebbe senza riduzione della superficie di attacco

  1. Disattivare tutte le regole di riduzione della superficie di attacco usando i comandi di PowerShell nella sezione pulizia.

  2. Scaricare qualsiasi file/documento di test e abilitare la modifica e il contenuto, se richiesto.

Risultati previsti dello scenario 4

  • I file in c:\demo sono crittografati ed è necessario ricevere un messaggio di avviso
  • Eseguire di nuovo il file di test per decrittografare i file

Pulizia

Scaricare ed eseguire questo script di pulizia

In alternativa, è possibile eseguire questi passaggi manuali:

Add-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EfC-AADC-AD5F3C50688A -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 3B576869-A4EC-4529-8536-B80A7769E899 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D3E037E1-3EB8-44C8-A917-57927947596D -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids D1E49AAC-8F56-4280-B9BA-993A6D77406C -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568109D35 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 01443614-CD74-433A-B99E-2ECDC07BFC25 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 56a863a9-875e-4185-98a7-b882c64b5ce5 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids e6db77e5-3df2-4cf1-b95a-636979351e5b -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids a8f5898e-1dc8-49a9-9878-85004b8a61e6 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 26190899-1602-49E8-8B27-EB1D0A1CE869 -AttackSurfaceReductionRules_Actions Disabled
Add-MpPreference -AttackSurfaceReductionRules_Ids 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -AttackSurfaceReductionRules_Actions Disabled

Pulire la crittografia c:\demo eseguendo il file di crittografia/decrittografia

Vedere anche

Guida alla distribuzione delle regole di riduzione della superficie di attacco

Informazioni di riferimento sulle regole di riduzione della superficie di attacco

Microsoft Defender per endpoint - Scenari dimostrativi

Consiglio

Per saperne di più, Engage con la community Microsoft Security nella community tech: Microsoft Defender per endpoint Tech Community.