From d6bae249756a74b07d0a41d5e5df87b3565e522a Mon Sep 17 00:00:00 2001 From: Aleff Date: Fri, 14 Jul 2023 11:21:09 +0200 Subject: [PATCH] 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. --- .../payload.txt | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 payloads/library/prank/Defend_yourself_against_CVE-2023-36884_Office_and_Windows_HTML_R/payload.txt diff --git a/payloads/library/prank/Defend_yourself_against_CVE-2023-36884_Office_and_Windows_HTML_R/payload.txt b/payloads/library/prank/Defend_yourself_against_CVE-2023-36884_Office_and_Windows_HTML_R/payload.txt new file mode 100644 index 00000000..e9bb3d46 --- /dev/null +++ b/payloads/library/prank/Defend_yourself_against_CVE-2023-36884_Office_and_Windows_HTML_R/payload.txt @@ -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