Defend yourself against CVE-2023-36884 Office and Windows HTML Remote Code Execution Vulnerability

This script allows you to set the Register Key block rule that will allow you to defend against CVE-2023-36884.
pull/648/head
Aleff 2023-07-14 11:21:09 +02:00 committed by GitHub
parent 856579039a
commit d6bae24975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,85 @@
REM #######################################################################################################################
REM # |
REM # Title : Defend yourself against CVE-2023-36884 Office and Windows HTML Remote Code Execution Vulnerability |
REM # Author : Aleff |
REM # Version : 1.0 |
REM # Category : Incident Response |
REM # Target : Windows 10/11 |
REM # |
REM #######################################################################################################################
REM PlugAndPlay <3
REM Requirements:
REM - ExecutionPolicy Bypass
REM Impact: Remote Code Execution
REM Max Severity: Important
REM Mitigation:
REM - Customers who use Microsoft Defender for Office are protected from attachments that attempt to exploit this vulnerability.
REM - The registry key FEATURE_BLOCK_CROSS_PROTOCOL_FILE_NAVIGATION is located in the Main folder under the Internet Explorer settings, within the path HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\FeatureControl. This registry key is used to mitigate the vulnerability known as "Office and Windows HTML Remote Code Execution Vulnerability" (CVE-2023-36884).
REM The CVE-2023-36884 vulnerability allows remote code execution through the processing of HTML files by Office and Windows applications. Creating this registry key and adding specific application values, such as REG_DWORD with data 1, helps block cross-protocol file navigation to mitigate the exploitation of this vulnerability.
REM It is recommended to implement these protective measures to prevent potential attacks that could exploit the vulnerability and compromise the security of Office and Windows systems. It is important to understand the implications of modifying the registry and carefully evaluate the impact on the regular functionality of the involved applications.
REM Source: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36884
DELAY 1000
GUI x
DELAY 500
STRING a
DELAY 500
LEFTARROW
DELAY 500
ENTER
REM Sets the path to the registry key
STRINGLN $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BLOCK_CROSS_PROTOCOL_FILE_NAVIGATION"
REM Array of application names
STRING $applicationNames = @(
ENTER
STRING "Excel.exe",
ENTER
STRING "Graph.exe",
ENTER
STRING "MSAccess.exe",
ENTER
STRING "MSPub.exe",
ENTER
STRING "Powerpnt.exe",
ENTER
STRING "Visio.exe",
ENTER
STRING "WinProj.exe",
ENTER
STRING "WinWord.exe",
ENTER
STRING "Wordpad.exe"
ENTER
STRING )
ENTER
REM Create the registry key if it does not already exist
STRING if (!(Test-Path $registryPath)) {
ENTER
STRING New-Item -Path $registryPath -Force | Out-Null
ENTER
STRING echo "Registry key created"
ENTER
STRING }
ENTER
REM Add the values to the registry key
STRING foreach ($appName in $applicationNames) {
ENTER
STRING Set-ItemProperty -Path $registryPath -Name $appName -Value 1 -Type DWORD -Force | Out-Null
ENTER
STRING echo "[+] $appName"
ENTER
STRING }
ENTER