Threat intelligence analysts Mohamed Fahmy, Sherif Magdy and Abdelrhman Sharshar said in a blog post that both ProxyLogon and ProxyShell exploits were used to send malicious emails as replies to existing mail chains.
This ensured that the recipients had little suspicion about the malicious emails as they were coming from servers on their own premises.
The three researchers examined a number of intrusions in the Middle East which used the new loader Squirrelwaffle.
Detailing what had happened, the Trend Micro trio said of the use of ProxyLogon: "This server-side request forgery (SSRF) vulnerability can allow a threat actor access by sending a specially crafted Web request to an Exchange Server. The Web request contains an XML payload directed at the Exchange Web Services (EWS) API endpoint.
"The request bypasses authentication using specially crafted cookies and allows an unauthenticated threat actor to execute EWS requests encoded in the XML payload then ultimately perform operations on victims’ mailboxes.
"From our analysis of the IIS [Internet Information Server] log, we saw that the threat actor uses a publicly available exploit in its attack. This exploit gives a threat actor the ability to get users SID and emails. They can even search for and download a target’s emails."
There were two vulnerabilities used in the ProxyShell attacks. One, documented as CVE-2021-34473, is exploited as an abuse of "the URL normalisation of the explicit Logon URL, wherein the logon email is removed from the URL if the suffix is autodiscover/autodiscover.json. This grants arbitrary backend URL the same access as the Exchange machine account (NT AUTHORITY\SYSTEM)".
The second flaw, documented as CVE-2021-34523, is an Exchange PowerShell backend elevation-of-privilege.
Said Fahmy, Magdy and Sharshar: "Exchange has a PowerShell remoting feature that can be used to read and send emails. It can’t be used by NT AUTHORITY\SYSTEM as it does not have a mailbox.
"However, in cases where it is accessed directly via the previous vulnerability, the backend/PowerShell can be provided with X-Rps-CAT query string parameter. The backend/PowerShell will be deserialised and used to restore user identity. It can therefore be used to impersonate a local administrator to run PowerShell commands."
In one intrusion, the malicious emails were sent as legitimate replies to existing email threads.
"In the same intrusion, we analysed the email headers for the received malicious emails, the mail path was internal (between the three internal exchange servers’ mailboxes), indicating that the emails did not originate from an external sender, open mail relay, or any message transfer agent," the Trend Micro researchers said.
They pointed out that this meant that it was not safe to conclude that a particular email was safe even if it came from a trusted contact.