GhostContainer is a modular .NET backdoor targeting Microsoft Exchange servers on Windows. It is associated with the NightEagle threat group, also tracked as APT-Q-95, and has been observed in attacks against government and high-technology organizations in Asia and manufacturing and construction enterprises in Russia.
The backdoor provides remote command execution, shellcode execution, loading of additional .NET payloads, and file download, reading, writing, and deletion. Its proxy and socket-forwarding components establish tunnels between external systems and internal hosts. GhostContainer receives encrypted commands through HTTP headers in incoming Exchange web requests rather than beaconing to dedicated command-and-control infrastructure. It derives an AES key from the server's ASP.NET machine validation key and disguises its activity within Exchange traffic.
GhostContainer patches Windows security functions to bypass AMSI scanning and Windows Event Log mechanisms. It also creates virtual ASP.NET pages to execute code without corresponding physical page files. The implementation incorporates public code from Neo-reGeorg, Exchange exploitation tooling, and ysoserial components. In investigated NightEagle incidents, operators deployed it after entering corporate networks with compromised VPN credentials; the precise mechanism used to install the backdoor on Exchange servers has not been established.
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
After gaining access through VPN accounts, the attackers deployed the GhostContainer backdoor on Microsoft Exchange servers. It is assembled from components of several open-source projects, including Neo-reGeorg, an exploit for CVE-2020-0688, and ysoserial components.
22 distinct techniques documented for this family, organized by ATT&CK tactic.
[GhostContainer] includes elements connected to the Neo-reGeorg tunnel, code for CVE-2020-0688, and the GhostWebShell class.
“Detection of a malicious DLL’s .NET assembly being loaded via PowerShell: suspicious_assembly_loading_into_powershell_via_reflection.”
C2 commands and functionality: Command ID Description... 2 Execute a command line
Command ID Description 1 Run received data as a shell code
It acts as a C2 command parser, capable of executing shellcode, downloading files, running commands, and loading additional .NET byte code... 3 Load .NET byte code in a child thread
Хакеры могли извлекать криптографические ключи Exchange из конфигурации ASP.NET, модифицировать параметр VIEWSTATE и таким образом запускать вредонос прямо в памяти сервера.
После этого атакующие размещали на серверах Microsoft Exchange бэкдор GhostContainer.
One of the most notable features is that it creates an instance of the App_Web_843e75cf5b63, which serves as a loader for the web proxy class (App_Web_8c9b251fb5b3) via a virtual page injector.
“The names of the repositories and archives were disguised to look legitimate” and “files contained within the archives were also given names mimicking known legitimate software.”
One of the most notable features is that it creates an instance of the App_Web_843e75cf5b63, which serves as a loader for the web proxy class (App_Web_8c9b251fb5b3) via a virtual page injector.
Command ID Description... 7 Delete a file... 11 Iterate and delete files whose names contain App_Global in the defined folder and its subdirectories
“extracting encryption keys from Exchange and manipulating Microsoft's web application framework to execute the backdoor directly in the server's memory.”
To execute commands, Stub checks if the current user is a system account. If it is not, it attempts to impersonate a user by utilizing a token stored in the application domain’s data storage.
GhostContainer ... способен ... обходить AMSI и механизмы журналирования Windows.
«обходит ... механизмы журнала событий Windows (Event Log) путем перезаписи адресов в ... ntdll.dll»
Next, it retrieves the machine key from the ASP.NET configuration, specifically the validation key, and converts it to a byte array.
Command ID Description... 8 Read file contents
«извлекали из конфигурации ASP.NET криптографические ключи, используемые Microsoft Exchange, перезаписывали параметр фреймворка VIEWSTATE и внедряли в него полезную нагрузку»; «эксплуатировали ... CVE-2019-0708 (BlueKeep)»
GhostContainer can receive commands through Exchange web headers.
В результате бэкдор способен перенаправлять сетевой трафик.
It acts as a C2 command parser, capable of executing shellcode, downloading files, running commands, and loading additional .NET byte code... 5 Download and save a file
If the header is Dzvvlnwkccf, the malware establishes or manages a long-lived TCP tunnel connection between the internet and intranet.
it can function as a proxy or tunnel, potentially exposing the internal network to external threats or facilitating the exfiltration of sensitive data from internal devices... Receives data from the internal network, encodes it, and sends it back to the attacker as an HTTP response body.
5 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
14 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.