{"id":110202,"date":"2023-07-19T12:00:41","date_gmt":"2023-07-19T12:00:41","guid":{"rendered":"https:\/\/kasperskycontenthub.com\/securelist\/?p=110202"},"modified":"2023-07-19T09:43:20","modified_gmt":"2023-07-19T09:43:20","slug":"analysis-of-attack-samples-exploiting-cve-2023-23397","status":"publish","type":"post","link":"https:\/\/securelist.com\/analysis-of-attack-samples-exploiting-cve-2023-23397\/110202\/","title":{"rendered":"Comprehensive analysis of initial attack samples exploiting CVE-2023-23397 vulnerability"},"content":{"rendered":"
On March 14, 2023, Microsoft published a blogpost<\/a> describing an Outlook Client Elevation of Privilege Vulnerability (CVSS: 9.8 CRITICAL). The publication generated a lot of activity among white, grey and black hat researchers, as well as lots of publications and tweets about the vulnerability and its exploitation. Below, we will highlight the key points and then focus on the initial use of this vulnerability by attackers before it became public.<\/p>\n Affected products include all supported versions of Microsoft Outlook for Windows. Other versions of Microsoft Outlook, such as those for Android, iOS, macOS, and Outlook on the web and other MS365 services, are not affected.<\/p>\n From a technical point of view, the vulnerability is a critical EoP that is triggered when an attacker sends an Outlook object (task, message, or calendar event) within an extended MAPI property that contains a UNC path to an SMB share on a threat actor-controlled server, resulting in a Net-NTLMv2 hash leak. No user interaction is required.<\/strong> The NTLM leak occurs when the reminder window is displayed, not just when the message is received. However, an already expired reminder will be fired immediately upon receipt of the object!<\/p>\n The connection to the remote SMB server sends the user’s Net-NTLMv2 hash in a negotiation message, which the threat actor can use to either:<\/p>\n Note:<\/strong> as these are NTLMv2 hashes, they cannot be leveraged as part of a Pass-the-Hash technique.<\/p>\n The affected Net-NTLMv2 hash belongs to the user currently signed in to the Windows device where the Outlook client application is running, regardless of the identity that received the malicious message. If the user does not dismiss the Outlook reminder\/task alert, or if the reminder is recurring (i.e., fires multiple times), the user’s Net-NTLMv2 hash may be leaked multiple times.<\/p>\n The fix in the Outlook client code for CVE-2023-23397<\/a> is that Outlook’s PlayReminderSound() now calls IsFileZoneLocalIntranetOrTrusted(), which uses MapUrlToZone()<\/a> to honor the SMB URI only if it is in a trusted\/local zone. This means that a UNC path to an INTRANET\/TRUSTED local zone can still be abused even on a patched MS Outlook client (SMB local exploitability should still be possible).<\/p>\n It appears that the implemented fix could be easily bypassed<\/a> by forging the malicious UNC path with a particular format, then even a patched client could still be vulnerable (feature bypass vulnerability has been assigned CVE-2023-29324<\/a> and patched in May 2023) However, the hotfix is still effective on the server side and the exploit vector couldn’t be a CVE-2023-23397 patched Exchange server because it removes the extended MAPI property containing the malicious UNC path on any object in transit.<\/p>\n In the MS Guidance for investigating attacks using CVE-2023-23397<\/a>, \u00a0there is a note about WebDAV reported below: It seems WebDAV already implements proper checks with regard to local intranet\/trusted resources, and MS only considers the leak effective when it appears to an external entity. So, the logical assumption should be: “The WebDAV protocol is not at risk of leaking credentials via this exploit technique TO ANY NETWORK EXTERNAL ENTITY”. What about the local exploitability of WebDAV?<\/p>\n UNC paths can also be used to make a WebDAV request to an external domain, either by SMB falling back to WebDAV (if SMB traffic to the internet is blocked or otherwise fails, Windows will fall back to using WebDAV \u2013 if available \u2013 to try to complete the connection), or by forcing WebDAV by appending “@80” or “@SSL@443” to the host name.<\/p>\n Internal tests appear to confirm that WebDAV is locally abusable by forcing the use of WebDAV through appending @<port> to the hostname and by using a dotless hostname (considered local network zone by WebDAV); then local exploitability should be possible on a PATCHED client for both SMB and WebDAV.<\/p>\n Evidence of these vulnerabilities being exploited by an unknown attacker has been made public via the submission of samples to VirusTotal. Some samples submitted to VirusTotal in the past were later found to exploit CVE-2023-23397; others were published after the vulnerability was publicly disclosed.<\/p>\n Three variations of the samples were found on VirusTotal:<\/p>\n Many initial publications about these samples referred to April 2022 as the first available evidence because the “FirstSeen VT” field on the oldest sample timestamp was 2022-04-14 (with a received timestamp in the mail header on the same day).<\/p>\n However, a later sample appeared (in a different format \u2013 TNEF attachment in .eml \u2013 that was not detected by the first version of the YARA rule used by VirusTotal) with a “FirstSeen VT” timestamp of 2022-04-01 and a received timestamp in the mail header of 2022-03-18. In any case, the vulnerability was at the disposal of the first attacker for at least a year.<\/p>\n All publicly available samples found range from 2022-03-18 to 2023-03-29 (this is the last timestamp found in a sample related to a real-world exploit attempt by the attacker). All other samples with a “FirstSeen VT” timestamp starting from 2023-03-15 are mainly tests or POCs or just TNEF attachments missing target and reference timestamp details.<\/p>\n <\/a><\/p>\n Timeline of detected samples<\/em><\/p>\n 2022-03-18 – \u043b\u0438\u0441\u0442.eml Happy Birthday..msg Celebration.msg Information!.msg Silence..eml Interest..msg Information!.msg Fwd..msg Fwd..msg Silence..msg Silence..msg Silence..msg Fwd..msg<\/strong> VT First Submission 2022-12-01 09:37:36 UTC Fwd..msg Report.eml Ticaret.msg Unknown<\/strong> Alarms!.msg Power! Reminder! Reminder!.eml Reminder!.eml CC.eml Threat-relevant IOCs are the embedded malicious UNC paths and IPs (not hashes of sample files, which are just an export in MSG\/EML format of the malicious TASK exploiting the vulnerability and useless for threat detection\/verification).<\/p>\n URLs (#16)<\/strong><\/p>\n \\\\5.199.162[.]132\\SCW IPs (#14)<\/strong><\/p>\n 5.199.162[.]132 (not in MS Guidance publication) Any attempt to communicate to the IPs\/URIs listed in the above IOCs<\/strong> and found in any logs should be considered suspicious and investigated further.<\/p>\n Alternatively, to determine if an organization has been targeted by attempts to exploit this vulnerability, Microsoft has provided documentation<\/a> for a script that checks all Outlook objects (tasks, email messages and calendar items) to see if the specific property is populated with a UNC path. If objects are detected that point to an unrecognized share, they should be investigated further. Microsoft has provided detailed guidance<\/a> on how to do this.<\/p>\n It’s easy to see that many of the IPs used by the attacker have\/had similarities in terms of connected equipment.<\/p>\n This is obviously not random, but a common point for the attacker.<\/p>\n One of the IPs used by the attacker exposes the WebUI of an internet access router:<\/p>\n <\/a><\/p>\nThe CVE-2023-23397 vulnerability<\/h2>\n
\n
The vulnerability fix<\/h3>\n
The WebDAV protocol<\/h3>\n
\n“Note: Interaction based on the WebDAV protocol is not at risk of leaking credentials via this exploit technique. While the threat actor infrastructure might request Net-NTLMv2 authentication, Windows will honor the defined internet security zones and will not send (leak) Net-NTLMv2 hashes. In other words, the vulnerability only affects the SMB protocol. If a target device can communicate to threat actor infrastructure over port 445 (SMB), Net-NTLMv2 hashes might be sent; however, if this communication via SMB is not possible, Windows will fall back to leveraging WebDAV. WebDAV will set up a connection with the threat actor infrastructure, but Net-NTLMv2 hashes will not be sent.”<\/p>\nThe samples<\/h2>\n
\n
Sample list<\/h2>\n
\n
\n<\/strong>VT First Submission 2022-04-01 06:21:07 UTC
\nUNC path \\\\5.199.162.132\\SCW <\/strong>(reminder time set to 2019-05-06 20:00)
\nSent by: 5.199.162.132 on 2022-03-18 12:01:09 UTC <- THE OLDEST PUBLIC EVIDENCE FOUND TO DATE<\/span><\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-04-14 11:49:27 UTC
\nUNC path \\\\101.255.119.42\\event\\2431 <\/strong>(reminder time set to 2020-10-06 20:00)
\nSent by: 101.255.119.42 on 2022-04-14 10:35:39 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-05-18 07:26:26 UTC
\nUNC path \\\\101.255.119.42\\mail\\a5b3553d <\/strong>(reminder time set to 2020-04-07 11:30)
\nSent by: 101.255.119.42 on 2022-05-17 14:21:25 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-08-05 08:22:49 UTC <\/strong>
\nUNC path relates to 181.209.99.204 <\/strong>based on VT information should be \\\\181.209.99.204\\information<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-23 09:03:23 UTC, but its TNEF attachment VT First Submission 2022-09-29 11:29:43 UTC
\nUNC path \\\\213.32.252.221\\silence <\/strong>(reminder time set to 2020-03-10 10:30)
\nSent by: 213.32.252.221 on 2022-09-09 09:04:23 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-10-05 14:10:40 UTC <\/strong>
\nUNC path relate to 213.32.252.221<\/strong> based on VT information<\/p>\n\n
\n<\/strong>VT First Submission 2022-10-25 10:00:00 UTC
\nUNC path \\\\168.205.200.55\\test <\/strong>(reminder time set to 2019-02-17 19:00)
\nSent by: 168.205.200.55 on 2022-10-25 09:12:02 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-11-04 09:28:28 UTC
\nUNC path \\\\213.32.252.221\\fwd <\/strong>(reminder time set to 2020-03-17 02:30)
\nSent by: 213.32.252.221 on 2022-11-03 11:07:23 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-11-04 09:27:32 UTC <\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-11-04 18:41:05 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-11-08 20:41:31 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-11-09 06:50:41 UTC<\/strong>
\nUNC path relate to 213.32.252.221<\/strong> based on VT infos<\/p>\n\n
\nUNC path \\\\69.162.253.21\\pets <\/strong>(reminder time set to 2020-03-09 23:30)
\nSent on 2022-12-01 06:18:15 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2022-12-01 12:19:18 UTC
\nUNC path \\\\185.132.17.160\\aojv43 <\/strong>(reminder time set to 2021-04-21 11:30)
\nSent on 2022-12-01 11:59:46 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-12-14 08:47:25 UTC
\nUNC path \\\\69.51.2.106\\report <\/strong>(reminder time set to 2021-05-19 00:30)
\nSent by: 69.51.2.106 on 2022-12-14 07:05:18 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2022-12-29 13:00:43 UTC & VT First Submission 2023-03-16 13:05:21 UTC
\nUNC path \\\\113.160.234.229\\istanbul <\/strong>(reminder time set to 2022-09-05 22:00)
\nSent by: 113.160.234.229 on 2022-12-29 12:39:33 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-21 10:47:06 UTC
\nUNC path \\\\85.195.206.7\\lrmng<\/strong>
\nSent by: 85.195.206.7 on 2023-03-15 16:07:48 UTC <\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-16 13:02:30 UTC<\/strong>
\nUNC path \\\\85.195.206.7\\lrmng <\/strong>(reminder time set to 2022-02-03 23:30)
\nSent by: 85.195.206.7 on 2023-03-15 16:15:07 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-20 07:55:32 UTC
\nUNC path \\\\85.195.206.7\\power <\/strong>(reminder time set to 2022-01-31 23:30)
\nSent by: 77.238.121.148 on 2023-03-17 14:04:54 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-22 12:20:44 UTC
\nUNC path \\\\61.14.68.33\\rem <\/strong>(reminder time set to 2022-06-28 21:30)
\nSent by: 77.238.121.148 on 2023-03-21 11:13:14 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-29 06:51:54 UTC
\nUNC path \\\\61.14.68.33\\rem <\/strong>(reminder time set to 2022-06-28 21:30)
\nSent by: 77.238.121.148 on 2023-03-22 09:13:09 UTC<\/strong><\/p>\n
\n<\/strong>VT First Submission 2023-03-27 08:59:44 UTC
\nUNC path \\\\61.14.68.33\\rem <\/strong>(reminder time set to 2022-06-28 21:30)
\nSent by: 77.238.121.148 on 2023-03-22 09:17:19 UTC<\/strong><\/p>\n\n
\n<\/strong>VT First Submission 2023-03-29 13:51:50 UTC
\nUNC path \\\\42.98.5.225\\ping <\/strong>(reminder time set to 2023-01-31 01:00)
\nSent by: 42.98.5.225 on 2023-03-29 12:36:10 UTC<\/strong><\/p>\nInitial attack IOCs<\/h2>\n
\n\\\\101.255.119[.]42\\event\\2431
\n\\\\101.255.119[.]42\\mail\\a5b3553d
\n\\\\181.209.99[.]204\\information
\n\\\\213.32.252[.]221\\silence
\n\\\\168.205.200[.]55\\test
\n\\\\213.32.252[.]221\\fwd
\n\\\\69.162.253[.]21\\pets
\n\\\\185.132.17[.]160\\aojv43
\n\\\\69.51.2[].106\\report
\n\\\\113.160.234[.]229\\istanbul
\n\\\\85.195.206[.]7\\lrmng
\n\\\\24.142.165[.]2\\req
\n\\\\85.195.206[.]7\\power
\n\\\\61.14.68[.]33\\rem
\n\\\\42.98.5[.]225\\ping<\/p>\n
\n101.255.119[.]42
\n181.209.99[.]204
\n213.32.252[.]221
\n168.205.200[.]55
\n69.162.253[.]21
\n185.132.17[.]160
\n69.51.2[.]106 (not in MS Guidance publication)
\n113.160.234[.]229
\n85.195.206[.]7
\n24.142.165[.]2 (not in MS Guidance publication)
\n61.14.68[.]33
\n42.98.5[.]225 (not in MS Guidance publication)
\n82.196.113[.]102 (only in MS Guidance publication \u2013 on VT relating to hash 92df1d2125f88d0642e0d4919644376c09e1f1e0eaf48c31a6b389265e0d5576, but missing the sample and any additional information)<\/p>\nThreat verification<\/h2>\n
A note about attacker infrastructure<\/h2>\n
\n\n
\n IP<\/th>\n Net exposed service history<\/th>\n<\/tr>\n \n 5.199.162[.]132<\/td>\n No Info<\/td>\n<\/tr>\n \n 101.255.119[.]42<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 181.209.99[.]204<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks<\/td>\n<\/tr>\n \n 213.32.252[.]221<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks<\/td>\n<\/tr>\n \n 168.205.200[.]55<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, port UDP 10001 Ubiquiti Networks Device_Hostname: _Product: N5N_Version: XM.ar7240.v5.6.6.29183.160526.1225 @2022-06-16<\/td>\n<\/tr>\n \n 69.162.253[.]21<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, port UDP 10001<\/td>\n<\/tr>\n \n 185.132.17[.]160<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 69.51.2[.]106<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 113.160.234[.]229<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 85.195.206[.]7<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks<\/td>\n<\/tr>\n \n 24.142.165.2<\/td>\n No Info<\/td>\n<\/tr>\n \n 61.14.68[.]33<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 42.98.5[.]225<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n \n 82.196.113[.]102<\/td>\n HTTP redirect to HTTPS, HTTPS cert Subject: C=US, CN=UBNT Router UI<\/strong>, O=Ubiquiti Networks, SSH on port 2222<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n