Merge pull request #192 from aleff-github/patch-56

Defend yourself against CVE-2023-36884 Office and Windows HTML Remote…
pull/216/head
Kalani Helekunihi 2023-12-07 13:28:51 -05:00 committed by GitHub
commit c51eaa44e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,118 @@
# 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.
**Category**: Incident Response
## Table of Contents
- [Payload Description](#payload-description)
- [CVE-2023-36884 Description](#cve-2023-36884-description)
- [Summary](#summary)
- [Note](#note)
- [Dependencies](#dependencies)
- [Settings](#settings)
- [Administrative Privileges](#administrative-privileges)
- [Set the rule](#set-the-rule)
- [See the new rule](#see-the-new-rule)
- [Remove the rule](#remove-the-rule)
- [Credits](#credits)
## Payload Description
This script allows you to set the Register Key block rule that will allow you to defend against CVE-2023-36884.
Open a PowerShell, set the Register Key block rule trough the [command line interface](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.3).
![](docs/2.png)
## CVE-2023-36884 Description
### Summary
Microsoft is investigating reports of a series of remote code execution vulnerabilities impacting Windows and Office products. Microsoft is aware of targeted attacks that attempt to exploit these vulnerabilities by using specially-crafted Microsoft Office documents.
An attacker could create a specially crafted Microsoft Office document that enables them to perform remote code execution in the context of the victim. However, an attacker would have to convince the victim to open the malicious file.
Upon completion of this investigation, Microsoft will take the appropriate action to help protect our customers. This might include providing a security update through our monthly release process or providing an out-of-cycle security update, depending on customer needs.
Please see the Microsoft Threat Intelligence [Blog Entry](https://www.microsoft.com/en-us/security/blog/2023/07/11/storm-0978-attacks-reveal-financial-and-espionage-motives/) for important information about steps you can take to protect your system from this vulnerability.
This CVE will be updated with new information and links to security updates when they become available. If you wish to be notified when these updates are released, we recommend that you register for the security notifications mailer to be alerted of content changes to this CVE. See [Microsoft Technical Security Notifications](https://www.microsoft.com/en-us/msrc/technical-security-notifications?rtc=1) and [Security Update Guide Notification System News: Create your profile now Microsoft Security Response Center](https://msrc.microsoft.com/blog/2022/08/security-update-guide-notification-system-news-create-your-profile-now/).
Source: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36884
### Note
Tested on:
- Windows 11 Eng
### Dependencies
* ExecutionPolicy Bypass
## Settings
In this payload, I created a new registry key called "FEATURE_BLOCK_CROSS_PROTOCOL_FILE_NAVIGATION." All of the following application names are then added as a value of type REG_DWORD with data 1.
- Excel.exe
- Graph.exe
- MSAccess.exe
- MSPub.exe
- Powerpnt.exe
- Visio.exe
- WinProj.exe
- WinWord.exe
- Wordpad.exe
Remember that you must run PowerShell with administrative privileges to create and manage registry keys.
### Administrative Privileges
- I used the Payload [Starting a PowerShell with administrator permissions in Windows 10/11](https://github.com/hak5/usbrubberducky-payloads/tree/master/payloads/library/execution/Starting_a_PowerShell_with_administrator_permissions_in_Windows) by Hak5 Payloads
```
DELAY 1000
GUI x
DELAY 500
STRING a
DELAY 500
LEFT_ARROW
DELAY 500
ENTER
```
### Set the rule
![](docs/1.png)
### See the new rule
![](docs/2.png)
### Remove the rule
![](docs/3.png)
## Credits
<h2 align="center"> Aleff :octocat: </h2>
<div align=center>
<table>
<tr>
<td align="center" width="96">
<a href="https://github.com/aleff-github">
<img src=https://github.com/aleff-github/aleff-github/blob/main/img/github.png?raw=true width="48" height="48" />
</a>
<br>Github
</td>
<td align="center" width="96">
<a href="https://www.linkedin.com/in/alessandro-greco-aka-aleff/">
<img src=https://github.com/aleff-github/aleff-github/blob/main/img/linkedin.png?raw=true width="48" height="48" />
</a>
<br>Linkedin
</td>
</tr>
</table>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,72 @@
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
STRINGLN_BLOCK
$applicationNames = @(
"Excel.exe",
"Graph.exe",
"MSAccess.exe",
"MSPub.exe",
"Powerpnt.exe",
"Visio.exe",
"WinProj.exe",
"WinWord.exe",
"Wordpad.exe"
)
END_STRINGLN
REM Create the registry key if it does not already exist
STRINGLN_BLOCK
if (!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Force | Out-Null
echo "Registry key created"
}
END_STRINGLN
REM Add the values to the registry key
STRINGLN_BLOCK
foreach ($appName in $applicationNames) {
Set-ItemProperty -Path $registryPath -Name $appName -Value 1 -Type DWORD -Force | Out-Null
echo "[+] $appName"
}
END_STRINGLN