Path: blob/master/payloads/library/incident_response/Defend_yourself_from_CVE-2023-23397/payload.txt
2968 views
REM ########################################################1REM # |2REM # Title : Defend Yourself From CVE-2023-23397 |3REM # Author : Aleff |4REM # Version : 1.0 |5REM # Category : Incident-Response |6REM # Target : Windows 10/11 |7REM # |8REM ########################################################910REM PlugAndPlay <31112REM Requirements:13REM - ExecutionPolicy Bypass14REM - PayloadStudio 1.3.11516REM Impacted Products:17REM - 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.1819REM Mitigation:20REM - 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.21REM Source: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-233972223EXTENSION PASSIVE_WINDOWS_DETECT24REM VERSION 1.125REM AUTHOR: Korben2627REM_BLOCK DOCUMENTATION28Windows fully passive OS Detection and passive Detect Ready29Includes its own passive detect ready.30Does not require additional extensions.3132USAGE:33Extension runs inline (here)34Place at beginning of payload (besides ATTACKMODE) to act as dynamic35boot delay36$_OS will be set to WINDOWS or NOT_WINDOWS37See end of payload for usage within payload38END_REM3940REM CONFIGURATION:41DEFINE #MAX_WAIT 15042DEFINE #CHECK_INTERVAL 2043DEFINE #WINDOWS_HOST_REQUEST_COUNT 244DEFINE #NOT_WINDOWS 74546$_OS = #NOT_WINDOWS4748VAR $MAX_TRIES = #MAX_WAIT49WHILE(($_RECEIVED_HOST_LOCK_LED_REPLY == FALSE) && ($MAX_TRIES > 0))50DELAY #CHECK_INTERVAL51$MAX_TRIES = ($MAX_TRIES - 1)52END_WHILE53IF ($_HOST_CONFIGURATION_REQUEST_COUNT > #WINDOWS_HOST_REQUEST_COUNT) THEN54$_OS = WINDOWS55END_IF5657REM_BLOCK EXAMPLE USAGE AFTER EXTENSION58IF ($_OS == WINDOWS) THEN59STRING HELLO WINDOWS!60ELSE61STRING HELLO WORLD!62END_IF63END_REM64END_EXTENSION6566GUI x67DELAY 50068STRING a69DELAY 50070LEFTARROW71DELAY 50072ENTER7374REM Import NetSecurity module75STRINGLN Import-Module NetSecurity7677REM Create a new firewall rule for blocking outgoing connections on port 44578STRINGLN79$rule = New-NetFirewallRule -DisplayName "CVE-2023-23397" `80-Direction Outbound `81-Action Block `82-Protocol TCP `83-RemotePort 44584END_STRINGLN8586REM Enable firewall rule87STRINGLN Enable-NetFirewallRule -Name $rule.Name88DELAY 5008990REM See your new rule91STRINGLN Get-NetFirewallRule | Where-Object { $_.DisplayName -eq "CVE-2023-23397" }929394