Merge pull request #185 from aleff-github/patch-51

Defend Yourself From CVE-2023-23397
pull/216/head
Kalani Helekunihi 2023-12-07 13:31:01 -05:00 committed by GitHub
commit c275fa8a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,115 @@
# Defend Yourself From CVE-2023-23397
This script allows you to set the Firewall rule that will allow you to defend against CVE-2023-23397.
**Category**: Credentials
*I decided to set Credentials as the category because of the type of CVE.*
## Index
- [Defend Yourself From CVE-2023-23397](#defend-yourself-from-cve-2023-23397)
- [Payload Description](#payload-description)
- [CVE-2023-23397 Description](#cve-2023-23397-description)
- [Summary](#summary)
- [Impacted Products](#impacted-products)
- [Technical Details](#technical-details)
- [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 Firewall rule that will allow you to defend against CVE-2023-23397.
Open a PowerShell, set the Firewall rule trough NetSecurity module.
![](docs/2.png)
## CVE-2023-23397 Description
### Summary
Microsoft Threat Intelligence discovered limited, targeted abuse of a vulnerability in Microsoft Outlook for Windows that allows for new technology LAN manager (NTLM) credential theft to an untrusted network, such as the Internet. Microsoft has released CVE-2023-23397 to address the critical elevation of privilege (EoP) vulnerability affecting Microsoft Outlook for Windows. We strongly recommend all customers update Microsoft Outlook for Windows to remain secure.
### Impacted Products
All supported versions of Microsoft Outlook for Windows are affected. Other versions of Microsoft Outlook such as Android, iOS, Mac, as well as Outlook on the web and other M365 services are not affected.
### Technical Details
CVE-2023-23397 is a critical EoP vulnerability in Microsoft Outlook that is triggered when an attacker sends a message with an extended MAPI property with a UNC path to an SMB (TCP 445) share on a threat actor-controlled server on an untrusted network. No user interaction is required.
The threat actor is using a connection to the remote SMB server sends the users NTLM negotiation message, which the attacker can then relay for authentication against other systems that support NTLM authentication.
**Source**: https://msrc.microsoft.com/blog/2023/03/microsoft-mitigates-outlook-elevation-of-privilege-vulnerability/
## Note
Tested on:
- Windows 11 Eng
## Dependencies
* ExecutionPolicy Bypass
## Settings
In this payload, I created a new firewall rule called "CVE-2023-23397". The direction is set to "Outbound," the action is "Block" (block traffic), the protocol is "TCP," and the remote port is 445 (SMB). Next, the rule is enabled using the Enable-NetFirewallRule cmdlet by specifying the name of the previously created rule.
Remember that you must run PowerShell with administrative privileges to create and manage firewall rules.
### 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: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,49 @@
REM ########################################################
REM # |
REM # Title : Defend Yourself From CVE-2023-23397 |
REM # Author : Aleff |
REM # Version : 1.0 |
REM # Category : Credentials |
REM # Target : Windows 10/11 |
REM # |
REM ########################################################
REM PlugAndPlay <3
REM Requirements:
REM - ExecutionPolicy Bypass
REM Impacted Products:
REM - All supported versions of Microsoft Outlook for Windows are affected. Other versions of Microsoft Outlook such as Android, iOS, Mac, as well as Outlook on the web and other M365 services are not affected.
REM Mitigation:
REM - Block TCP 445/SMB outbound from your network by using a perimeter firewall, a local firewall, and via your VPN settings. This will prevent the sending of NTLM authentication messages to remote file shares.
REM Source: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-23397
DELAY 1000
GUI x
DELAY 500
STRING a
DELAY 500
LEFTARROW
DELAY 500
ENTER
REM Import NetSecurity module
STRINGLN Import-Module NetSecurity
REM Create a new firewall rule for blocking outgoing connections on port 445
STRINGLN_BLOCK
$rule = New-NetFirewallRule -DisplayName "CVE-2023-23397" `
-Direction Outbound `
-Action Block `
-Protocol TCP `
-RemotePort 445
END_STRINGLN
REM Enable firewall rule
STRINGLN Enable-NetFirewallRule -Name $rule.Name
DELAY 500
REM See your new rule
STRINGLN Get-NetFirewallRule | Where-Object { $_.DisplayName -eq "CVE-2023-23397" }