+44 (0)203 88 020 88

Menu

Search

Cyber Security News & Articles

 

Cyber Security
News & Articles

Trusted Cyber Security Experts
25+ Years Industry Experience
Ethical, Professional & Pragmatic

NOBELIUM’s Backdoor Malware: MagicWeb

Microsoft’s Threat Intelligence Center (MSTIC) have recently discovered a new malware capability that NOBELIUM are using called MagicWeb. Highly active threat actor NOBELIUM are known for targeting organisations across Europe, Central Asia, and the USA. First detected in 2020, they use unique malware that is usually tailored to their current target. The MagicWeb malware is deployed by the threat actors in already compromised systems, in order to create a backdoor to maintain access, and prevent future remediation by the target organisation that could precede eviction of the attacker.  

 

MagicWeb is not the first of its type to be used by NOBELIUM. In 2021, a similar piece of malware known as FoggyWeb was used to exfiltrate the configuration of Active Directory Federated Services (AD FS) servers, decrypt tokens, and download and execute additional components. FoggyWeb, like MagicWeb, exists as a persistent backdoor into previously compromised networks, to actively prevent the threat actor’s access from being repaired and the attackers evicted. Both versions of this malware target the AD FS servers, but unlike FoggyWeb, MagicWeb has been found to have the ability to facilitate the covert access for the attackers directly, rather than needing additional capabilities to establish a backdoor.  

 

Before NOBELIUM can deploy MagicWeb in a network, they first need to obtain highly privileged credentials and administrative privileges in the AD FS system. In their initial attack, NOBELIUM will execute elevation of privilege, then move laterally to obtain administrative access to an AD FS server. They can then implement MagicWeb as a post-compromise attack that allows them to authenticate as anyone. It is currently believed that MagicWeb is highly targeted, however other threat actors could use similar methodologies now that this information has been publicly disclosed. Microsoft have released a security blog post this week, after they discovered one of these backdoors during an ongoing incident response investigation with one of their clients. 

 

The target of this malware, the AD FS server, is a .NET application that evaluates  authentication claims coming from Security Assertion Markup Language (SAML) Single Sign-On (SSO) websites and web-based applications. It uses claims-based authentication to validate the identity of the user that is attempting to gain access. MagicWeb works by injecting itself into the claims process, before a security token is packaged and sent to the user to authenticate the sign-on. MagicWeb uses a hardcoded non-standard key during the authentication request process, in order to bypass the standard AD FS processes for validating a user, including bypassing any multi-factor authentication (MFA) checks.  

 

NOBELIUM create the backdoor with MagicWeb by copying the legitimate AD FS dynamic link library (DLL) file, Microsoft.IdentityServer.Diagnostics.dll. A copy can be identified as the legitimate file will be catalog signed by Microsoft, but the backdoored version of the file is unsigned. They do this by editing C:WindowsADFSMicrosoft.IdentityServer.Servicehost.exe.config and add malicious code to the TraceLog class, which adds a static constructor. This is used to guarantee that the malicious code is run before any legitimate code during the startup, as a different public token is specified, which controls what loads in the AD FS startup process. The DLL file is specified in the config file from the Global Assembly Cache (GAC), a code cache that stores assemblies needed to be shared by several different application on the same machine. 

 

The legitimate DLL file is normally loaded during AD FS startup to perform debugging capabilities. Instead, the threat actors modified file is executed, which contains a reference to the Initialize() method from the AuthLog class. AuthLog is a malicious class added by the threat actor, and the Initialize() method it contains references another NOBELIUM-added malicious class, RuntimeHelper. This is used to hook legitimate AD FS methods at runtime, through the use of its OverloadMethod() method. This hook allows the backdoor to intercept calls to legitimate methods, and instead run its own malicious methods. It can then bypass all policies, including role policies, device policies, and network policies, to sign in any user with any claims, including bypassing any need for MFA.  

 

No indicators of compromise (IOCs) have been shared for this malware, however as NOBELIUM customise their attacks for each target, it is likely that any previously identified IOCs would not match the static IOCs in an ongoing attack. Microsoft advise that one way to check for an infection with this sort of malware is through the presence of an unsigned DLL in the GAC. Through a PowerShell query, the catalog signature on the legitimate DLL can be viewed when the DLL is loaded. By crafting a list of servers to scan in a .txt file, a script containing get-authenticodesignature can be run to enumerate any non-Microsoft signed DLLs. As the copy used by MagicWeb is unsigned, this search can identify its presence in the network. A similar search can also be performed in Microsoft 365 Defender rather than in PowerShell.  

 

Clues that your network has been compromised can also be found in the event logs (as is always the case!) provided the AD FS logging is configured correctly.  According to Microsoft, you can: 

Hunt across Windows Event Logs by enabling AD FS verbose logging. Enable security auditing to allow collection of the AD FS event logs, and specifically look for Event ID 501. This event specifies all the EKU attributes on a claim. Hunt across these logs to look for EKU values which your PKI infrastructure isn’t configured to issue. 

AD FS servers are considered critical infrastructure, as they provide authentication, so they need to be protected with the same levels of protection used for a domain controller or other critical security infrastructure. Attackers gaining administrative access can not only perform the actions targeted by MagicWeb, but also have the ability to compromise the system further, and obfuscate their activity. To prevent administrative access, critical infrastructure in AD FS environments can be isolated, and regularly monitored with dedicated admin accounts as the only point of access. Guidance on AD FS hardening can be found on Microsoft’s website. Another consideration when using AD FS systems is that they use on-premises servers, so it is essential for the security of these systems that these servers do not become out of date or go unpatched, to best mitigate the risks of on-site compromise and lateral movement. 

 

 

Subscribe to our monthly newsletter today

If you’d like to stay up-to-date with the latest cyber security news and articles from our technical team, you can sign up to our monthly newsletter. 

We hate spam as much as you do, so we promise not to bombard you with emails. We’ll send you a single, curated email each month that contains all of our cyber security news and articles for that month.

Why Choose SecureTeam?

CREST
CCS
ISO9001
ISO27001
CE-PLUS

Customer Testimonials

“We were very impressed with the service, I will say, the vulnerability found was one our previous organisation had not picked up, which does make you wonder if anything else was missed.”

Aim Ltd Chief Technology Officer (CTO)

"Within a very tight timescale, SecureTeam managed to deliver a highly professional service efficiently. The team helped the process with regular updates and escalation where necessary. Would highly recommend"

IoT Solutions Group Limited Chief Technology Officer (CTO) & Founder

“First class service as ever. We learn something new each year! Thank you to all your team.”

Royal Haskoning DHV Service Delivery Manager

“We’ve worked with SecureTeam for a few years to conduct our testing. The team make it easy to deal with them; they are attentive and explain detailed reports in a jargon-free way that allows the less technical people to understand. I wouldn’t work with anyone else for our cyber security.”

Capital Asset Management Head of Operations

“SecureTeam provided Derbyshire's Education Data Hub with an approachable and professional service to ensure our schools were able to successfully certify for Cyber Essentials. The team provided a smooth end-to-end service and were always on hand to offer advice when necessary.”

Derbyshire County Council Team Manager Education Data Hub

“A very efficient, professional, and friendly delivery of our testing and the results. You delivered exactly what we asked for in the timeframe we needed it, while maintaining quality and integrity. A great job, done well.”

AMX Solutions IT Project Officer

“We were very pleased with the work and report provided. It was easy to translate the provided details into some actionable tasks on our end so that was great. We always appreciate the ongoing support.”

Innovez Ltd Support Officer

Get in touch today

If you’d like to see how SecureTeam can take your cybersecurity posture to the next level, we’d love to hear from you, learn about your requirements and then send you a free quotation for our services.

Our customers love our fast-turnaround, “no-nonsense” quotations – not to mention that we hate high-pressure sales tactics as much as you do.

We know that every organisation is unique, so our detailed scoping process ensures that we provide you with an accurate quotation for our services, which we trust you’ll find highly competitive.

Get in touch with us today and a member of our team will be in touch to provide you with a quotation. 

0

No products in the basket.

No products in the basket.