Excel: Block DIF En SYLK Files

πŸ’Ό Management Samenvatting

Block DIF (.dif) en SYLK (.slk) files - legacy spreadsheet formats (1980s) die gebruikt worden door malware voor formula injection attacks en command execution bypassing modern beveiligingscontroles.

Aanbeveling
Implementeer
Risico zonder
Medium
Risk Score
6/10
Implementatie
1u (tech: 0.5u)
Van toepassing op:
βœ“ Microsoft Excel

DIF/SYLK is legacy + dangerous: DIF (Data Interchange Format - 1980s), SYLK (Symbolic Link - 1984 Microsoft Multiplan format), Both plaintext formats (easy formula injection), DDE attacks possible (legacy command execution), CSV injection enhanced (SYLK formulas meer powerful). Attack: Malicious .slk file β†’ formula injection β†’ DDE command execution β†’ malware download. Zonder block: DIF/SYLK files bypass modern Macro beveiliging (formula-based attacks), No legitimate gebruiken (CSV superior voor data interchange).

Implementatie

File Block Settings: Block .dif (DIF files), Block .slk (SYLK files), complete block (open/save), nul business impact (use CSV instead voor data interchange).

Vereisten

  1. Office 2016+
  2. Intune of GPO

Implementeeratie

Intune Settings Catalog: Excel\Security\Vertrouwenscentrum\File Block Settings β†’ DIF en SYLK files: Block (open en save).

monitoring

Gebruik PowerShell-script dif-sylk-files-blocked.ps1 (functie Invoke-Monitoring) – Controleren.

monitor blocked DIF/SYLK attempts (any usage is investigate malware).

Compliance en Auditing

CIS Office Benchmark: Block legacy dangerous formats.

Remediatie

Gebruik PowerShell-script dif-sylk-files-blocked.ps1 (functie Invoke-Remediation) – Herstellen.

Compliance & Frameworks

Automation

Gebruik het onderstaande PowerShell script om deze security control te monitoren en te implementeren. Het script bevat functies voor zowel monitoring (-Monitoring) als remediation (-Remediation).

PowerShell
<# .SYNOPSIS Blokkeert Dif en Sylk bestanden in Excel voor Open/Save operaties .DESCRIPTION Dit script implementeert CIS control O365-EX-000021 voor het blokkeren van Dif en Sylk bestanden in Microsoft Excel. Dit voorkomt het openen en opslaan van potentieel onveilige Dif en Sylk bestanden die malware kunnen bevatten. .REQUIREMENTS - PowerShell 5.1 of hoger - Lokale administrator rechten voor registry wijzigingen - Microsoft Excel geΓ―nstalleerd .PARAMETER Monitoring Controleert de huidige compliance status .PARAMETER Remediation Past de aanbevolen configuratie toe .PARAMETER Revert Herstelt de originele configuratie .PARAMETER WhatIf Toont wat er zou gebeuren zonder wijzigingen door te voeren .EXAMPLE .\dif-sylk-files-blocked.ps1 -Monitoring Controleert of Dif en Sylk bestanden zijn geblokkeerd .EXAMPLE .\dif-sylk-files-blocked.ps1 -Remediation Blokkeert Dif en Sylk bestanden voor Open/Save operaties .NOTES Registry pad: HKCU:\Software\Policies\Microsoft\Office\16.0\Excel\Security\FileBlock\ExcelFiles Waarde: DifSylkFiles = 1 (Open/Save blocked, use open policy) CIS Control: O365-EX-000021 DISA STIG: Microsoft Office 365 ProPlus v3r3 #> #Requires -Version 5.1 param( [switch]$Monitoring, [switch]$Remediation, [switch]$Revert, [switch]$WhatIf ) # Globale variabelen $RegistryPath = "HKCU:\Software\Policies\Microsoft\Office\16.0\Excel\Security\FileBlock\ExcelFiles" $ValueName = "DifSylkFiles" $ExpectedValue = 1 $ControlID = "O365-EX-000021" function Test-Compliance { try { if (-not (Test-Path $RegistryPath)) { return $false } $currentValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue return ($currentValue -and $currentValue.$ValueName -eq $ExpectedValue) } catch { return $false } } function Invoke-Monitoring { Write-Host "Monitoring ${ControlID}: Dif en Sylk bestanden blokkeren voor Open/Save operaties" -ForegroundColor Green try { if (-not (Test-Path $RegistryPath)) { Write-Host "βœ— Registry pad bestaat niet: $RegistryPath" -ForegroundColor Red return $false } $currentValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue if ($currentValue -and $currentValue.$ValueName -eq $ExpectedValue) { Write-Host "βœ“ Control compliant: ${ValueName} = $ExpectedValue (Dif en Sylk bestanden geblokkeerd)" -ForegroundColor Green return $true } else { $actualValue = if ($currentValue) { $currentValue.$ValueName } else { "Not Set" } Write-Host "βœ— Control non-compliant: ${ValueName} = $actualValue (Expected: $ExpectedValue - Dif en Sylk bestanden moeten geblokkeerd zijn)" -ForegroundColor Red return $false } } catch { Write-Host "βœ— Fout bij controleren registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } function Invoke-Remediation { Write-Host "Remediating ${ControlID}: Dif en Sylk bestanden blokkeren voor Open/Save operaties" -ForegroundColor Yellow try { if ($WhatIf) { Write-Host "WhatIf: Zou registry waarde instellen: ${ValueName} = $ExpectedValue" -ForegroundColor Cyan return $true } if (-not (Test-Path $RegistryPath)) { Write-Host "Registry pad aanmaken: $RegistryPath" -ForegroundColor Yellow New-Item -Path $RegistryPath -Force | Out-Null } Set-ItemProperty -Path $RegistryPath -Name $ValueName -Value $ExpectedValue -Type DWord -Force Write-Host "βœ“ Registry waarde succesvol ingesteld: ${ValueName} = $ExpectedValue (Dif en Sylk bestanden geblokkeerd)" -ForegroundColor Green Start-Sleep -Seconds 1 return Invoke-Monitoring } catch { Write-Host "βœ— Fout bij configureren registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } function Invoke-Revert { Write-Host "Reverting ${ControlID}: Dif en Sylk bestanden blokkering herstellen" -ForegroundColor Yellow try { if ($WhatIf) { Write-Host "WhatIf: Zou registry waarde verwijderen: ${ValueName}" -ForegroundColor Cyan return $true } if (Test-Path $RegistryPath) { Remove-ItemProperty -Path $RegistryPath -Name $ValueName -ErrorAction SilentlyContinue Write-Host "βœ“ Registry waarde verwijderd: ${ValueName}" -ForegroundColor Green } return $true } catch { Write-Host "βœ— Fout bij herstellen registry instelling: $($_.Exception.Message)" -ForegroundColor Red return $false } } # Hoofd uitvoering try { if ($Monitoring) { $result = Invoke-Monitoring exit $(if ($result) { 0 } else { 1 }) } elseif ($Remediation) { $result = Invoke-Remediation exit $(if ($result) { 0 } else { 1 }) } elseif ($Revert) { $result = Invoke-Revert exit $(if ($result) { 0 } else { 1 }) } else { Write-Host "Gebruik: .\dif-sylk-files-blocked.ps1 [-Monitoring] [-Remediation] [-Revert] [-WhatIf]" -ForegroundColor Yellow Write-Host " -Monitoring: Controleer huidige compliance status" -ForegroundColor White Write-Host " -Remediation: Pas aanbevolen configuratie toe" -ForegroundColor White Write-Host " -Revert: Herstel originele configuratie" -ForegroundColor White Write-Host " -WhatIf: Toon wat er zou gebeuren" -ForegroundColor White Write-Host "" Write-Host "Handmatige configuratie:" -ForegroundColor Cyan Write-Host "Group Policy: User Configuration > Administrative Templates > Microsoft Excel 2016" -ForegroundColor White Write-Host "> Excel Options > Security > Trust Center > File Block Settings" -ForegroundColor White Write-Host "> Dif and Sylk files: Enabled: Open/Save blocked, use open policy" -ForegroundColor White } } catch { Write-Host "βœ— Onverwachte fout: $($_.Exception.Message)" -ForegroundColor Red exit 1 }

Risico zonder implementatie

Risico zonder implementatie
Medium: Medium: DIF/SYLK is formula injection, DDE attacks. Legacy 1980s formats. nul business gebruiken (use CSV).

Management Samenvatting

Blokkeer DIF (.dif) en SYLK (.slk) files. Formula injection attacks. gebruiken CSV instead. Implementeeratie: 30 min.