-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dpaul-setup
- Loading branch information
Showing
26 changed files
with
195 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### Microsoft Support Emergency Response Tool (MSERT) to scan Microsoft Exchange Server | ||
|
||
Microsoft Defender has included security intelligence updates to the latest version of the [Microsoft Safety Scanner](https://docs.microsoft.com/en-us/windows/security/threat-protection/intelligence/safety-scanner-download) (MSERT.EXE) to detect and remediate the latest threats known to abuse the [Exchange Server vulnerabilities](https://msrc-blog.microsoft.com/2021/03/05/microsoft-exchange-server-vulnerabilities-mitigations-march-2021/) disclosed on March 2, 2021. Administrators can use this tool for servers not protected by Microsoft Defender for Endpoint or where exclusions are configured for the recommended folders below. | ||
|
||
To use the Microsoft Support Emergency Response Tool (MSERT) to scan the Microsoft Exchange Server locations for known indicators from adversaries: | ||
|
||
1. Download MSERT from [Microsoft Safety Scanner Download – Windows security.](https://docs.microsoft.com/en-us/windows/security/threat-protection/intelligence/safety-scanner-download) **Note:** In case you need to troubleshoot it, see [How to troubleshoot an error when you run the Microsoft Safety Scanner](https://support.microsoft.com/en-us/topic/how-to-troubleshoot-an-error-when-you-run-the-microsoft-safety-scanner-6cd5faa1-f7b4-afd2-85c7-9bed02860f1c). | ||
2. Read and accept the **End user license agreement**, then click **Next**. | ||
3. Read the **Microsoft Safety Scanner Privacy Statement**, then click **Next**. | ||
4. Select whether you want to do full scan, or customized scan. | ||
|
||
- **Full scan** – The most effective way to thoroughly scan every file on the device. It is the most effective option although it might take a long time to complete depending on the directory size of your server. | ||
- **Customized scan** – This can be configured to scan the following file paths where malicious files from the threat actor have been observed: | ||
|
||
_%IIS installation path%\aspnet_client\*_ | ||
_%IIS installation path%\aspnet_client\system_web\*_ | ||
_%Exchange Server installation path%\FrontEnd\HttpProxy\owa\auth\*_ | ||
_%Exchange Server Installation%\FrontEnd\HttpProxy\ecp\auth\*_ | ||
_Configured temporary ASP.NET files path_ | ||
|
||
These remediation steps are effective against known attack patterns but are **not guaranteed as complete mitigation for all possible exploitation** of these vulnerabilities. Microsoft Defender will continue to monitor and provide the latest security updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,57 @@ | ||
# Security scripts | ||
|
||
## BackendCookieMitigation.ps1 | ||
## Test-ProxyLogon.ps1 | ||
|
||
This mitigation will filter https requests that contain malicious X-AnonResource-Backend and malformed X-BEResource cookies which were found to be used in the SSRF attacks in the wild. | ||
This will help with defense against the known patterns observed but not the SSRF as a whole. For more information, see the comments at the top of the script. | ||
Formerly known as Test-Hafnium, this script automates all four of the commands found in the [Hafnium blog post](https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/). It also has a progress bar and some performance tweaks to make the CVE-2021-26855 test run much faster. | ||
|
||
Download the latest release here: | ||
|
||
[Download BackendCookieMitigation.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/BackendCookieMitigation.ps1) | ||
[Download Test-ProxyLogon.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/Test-ProxyLogon.ps1) | ||
|
||
## http-vuln-cve2021-26855.nse | ||
The most typical usage of this script is to check all Exchange servers and save the output, | ||
by using the following syntax from Exchange Management Shell: | ||
|
||
This file is for use with nmap. It detects whether the specified URL is vulnerable to the Exchange Server SSRF Vulnerability (CVE-2021-26855). | ||
For usage information, please read the top of the file. | ||
`Get-ExchangeServer | .\Test-ProxyLogon.ps1 -OutPath $home\desktop\logs` | ||
|
||
Download the latest release here: | ||
To check the local server only, just run the script: | ||
|
||
[Download http-vuln-cve2021-26855.nse](https://github.com/microsoft/CSS-Exchange/releases/latest/download/http-vuln-cve2021-26855.nse) | ||
`.\Test-ProxyLogon.ps1 -OutPath $home\desktop\logs` | ||
|
||
## Test-ProxyLogon.ps1 | ||
To display the results without saving them, pass -DisplayOnly: | ||
|
||
`.\Test-ProxyLogon.ps1 -DisplayOnly` | ||
|
||
## BackendCookieMitigation.ps1 | ||
|
||
Formerly known as Test-Hafnium, this script automates all four of the commands found in the [Hafnium blog post](https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers/). It also has a progress bar and some performance tweaks to make the CVE-2021-26855 test run much faster. Download the latest release here: | ||
This mitigation will filter https requests that contain malicious X-AnonResource-Backend and malformed X-BEResource cookies which were found to be used in cve2021-26855. | ||
This will help with defense against the known patterns observed but not the SSRF as a whole. For more information please visit https://aka.ms/exchangevulns. | ||
|
||
For this script to work you must have the IIS URL Rewrite Module installed which can be done via this script using the -FullPathToMSI parameter. | ||
To obtain the IIS URL Rewrite Module visit the Official Microsoft IIS Site (https://www.iis.net/downloads/microsoft/url-rewrite), download the necessary MSI based off your systems info (x86 or x64), and save to each server locally along with this script. | ||
|
||
Script requires PowerShell 3.0 and later and must be executed from an elevated PowerShell Session. | ||
|
||
Download the latest release here: | ||
|
||
[Download Test-ProxyLogon.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/Test-ProxyLogon.ps1) | ||
[Download BackendCookieMitigation.ps1](https://github.com/microsoft/CSS-Exchange/releases/latest/download/BackendCookieMitigation.ps1) | ||
|
||
The most typical usage of this script is to check all Exchange servers and save the output, | ||
by using the following syntax from Exchange Management Shell: | ||
To apply with MSI install of the URL Rewrite module - Note: version may vary depending on system info | ||
|
||
`Get-ExchangeServer | .\Test-ProxyLogon.ps1 -OutPath $home\desktop\logs` | ||
`PS C:\> BackendCookieMitigation.ps1 -FullPathToMSI "C:\temp\rewrite_amd64_en-US.msi" -WebSiteNames "Default Web Site" -Verbose ` | ||
|
||
To check the local server only, just run the script: | ||
To apply without MSI install | ||
|
||
`.\Test-ProxyLogon.ps1 -OutPath $home\desktop\logs` | ||
`PS C:\> BackendCookieMitigation.ps1 -WebSiteNames "Default Web Site" -Verbose` | ||
|
||
To display the results without saving them, drop the -Outpath parameter from either example above: | ||
To rollback - Note: This does not remove the IIS Rewrite module, only the rules. | ||
|
||
`.\Test-ProxyLogon.ps1` | ||
`PS C:\> BackendCookieMitigation.ps1 -WebSiteNames "Default Web Site" -RollbackMitigation -Verbose` | ||
|
||
## http-vuln-cve2021-26855.nse | ||
|
||
This file is for use with nmap. It detects whether the specified URL is vulnerable to the Exchange Server SSRF Vulnerability (CVE-2021-26855). | ||
For usage information, please read the top of the file. | ||
|
||
Download the latest release here: | ||
|
||
[Download http-vuln-cve2021-26855.nse](https://github.com/microsoft/CSS-Exchange/releases/latest/download/http-vuln-cve2021-26855.nse) |
Oops, something went wrong.