CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Post-Exploitation Persistent Email Forwarder in Outlook Desktop

There is an exploitation method that can automatically forward emails CC’d to external addresses via an Outlook Desktop rule, even when this action is prevented on the corporate Exchange server.

This can be a serious data exfiltration risk allowing post-exploitation persistence in a previously breached account. The legitimate email account owner is highly likely to be unaware of the creation of this rule. It also permits legitimate non-breached account owners to bypass any Exchange rules prohibiting emails from being auto forwarded to external addresses.

If a user's email account has been breached, the standard advice is to change their password or implement multifactor authentication. Even if this is done, it will not prevent any emails from being auto forwarded to an external email account via the cc field of any sent emails. All the victim’s outbound emails can be sent to an external address belonging to an attacker in a manner which is unlikely to be discovered by the victim.

A user compromised in this way would be unlikely to scrutinize their sent emails, which would flag the suspicious cc'ing of emails being sent to an unknown external email address. If they do stumble onto this, it may not be for some time, which would still allow lots of emails to be exfiltrated.

This issue cannot be solved by any existing measures, including by configuring the Mail Flow rules settings in Exchange. This vulnerability has been reported to Microsoft. The company responded, stating that there is no fix for this vulnerability at present. Microsoft further stated that the Office product team would flag this for future review, but currently, there is no timeline for when this will occur. Also, this vulnerability has been submitted to the Mitre Att&ck Framework for review.

Currently, this is not a common attack method as it must take place post-exploitation, which means the attacker already must have some control over the system. This is more of a pentest/red team technique.

A potential attack scenario would follow these steps. An attacker convinces a victim to open a file that infects their system with a backdoor. The attacker uses the backdoor to gain access to Outlook Desktop and then triggers the attack in the post. If the attack gets discovered and the system cleaned up from the back door the attacker will still receive confidential emails to his inbox unless the IR team knows to look at the CC rules.

Even if this is accomplished, conducting an attack would be time consuming as each target would have to be hit individually. To counter this an attacker would likely pick their victim via a spearphishing attack to get the most bang for their buck.

Reproduction steps:

1) Open Outlook (Desktop).

2) Add an external email address that you can access for the purpose of this proof of concept into the address book. In this example the non-corporate external address joeblogs123@hackeremail.com is used.

3) Create a new email rule to apply to messages that are sent with the condition that `This is a confidential message’ in the subject field of sent messages. It can be any condition/wording, but this is just as an example.

4) Select the configuration option to `cc the message to people or public group’ and add any external address that has been included in the Outlook contacts list.

19094_picture1nn

Figure 1: Rules and Alerts

5) Choose a name for this rule.

6) To check if this works, create a test email with `this is a confidential message’ in the subject field and address it to anyone inside or outside the organization. Click `send’.

7) Check the sent folder and you will see that the external address specified in step 3) above was added automatically to the cc field.

19095_capturenn

Figure 2: Attacker email automatically added to the CC field 

8) Check that the external address (the one that was cc’d) has received the test email.

The above steps will work even if the Exchange server has created rules prohibiting the auto-forwarding of inbound emails to an external address.

Conclusion

Trustwave SpiderLabs notes that the attack takes place post-exploitation, which means that the attacker already must have some control over the system. This is more of a pentest/red team technique. Trustwave SpiderLabs hopes this information will be instructive for defenders, forensic analysts and incident responders as it gives them another checkbox to look for during a breach or cleanup.

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More