Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Magnitude Exploit Kit Backend Infrastructure Insight - Part I

In our recently released Trustwave Global Security Report Online and previous Magnitude blog post, A Peek Into the Lion's Den – The Magnitude [aka PopAds] Exploit Kit, we detailed our discovery of one of the more prevalent exploit kits seen these days, showed an inside look at the control panel and analyzed the kit's activity over one month.

The back-end infrastructure of Magnitude has revealed itself to be even more exciting than the front-end. With this post we'll provide more technical details about how the kit avoids detection.

Magnitude provides its customers with a good foundation for creating attacks with low detection rates. The most popular technique for making an attack undetectable is simply recreating everything from scratch and fast. The following scripts run in a cronjob and are responsible for different parts of the attack.

Exploit Obfuscation

The Magnitude author abuses the static analysis technology of Anti-Virus vendors by having a tool that re-creates its exploits periodically by randomizing every constant variable / function name.

Below is an example of the exploit outline, every part in the code surrounded by "%" will be replaced with a randomized string.


The PHP script uses a "preg_replace" function to replace the content, which is used almost in every part of the code.


After replacing the strings, the new content is written into a file and the exploit is ready for massive distribution.

Another script is responsible for re-generating the Java exploit, which is created on a different server and uploaded manually (for now) to the infection server. The process of creating the Java exploit is similar to other HTML based exploits - it loads an outline Java source file filled with patterns to be replaced.


The PHP script loads the files and uses regular expression to replace those occurrences.


Finally, after creating the Java files with the randomized strings, the script compiles the source code and wraps it to a Jar file:


Since the commands are clearly written for Windows rather than Linux, the Java exploit creation process probably takes place on a different, Windows based machine.

Domain Detection Rate

Just like security products, the Magnitude exploit kit operates on several layers. Most security products use the domain/URL as part of their detection logic, and so Magnitude provides its customers with the ability to load a set of domains that are constantly checked. Magnitude uses the Scan4you anti-virus detection service to scan IP/domains as well as files to make sure commercial anti-virus products cannot detect it. Once security vendors mark a domain as malware, the system updates the information in the database and quickly replaces the domain with a new one that is not yet detected by security vendors, which makes URL Filtering less effective.


According to the code above, the script also manually checks the domain with Google by using ""

"Used" Domains Removal

Rotating domains every several minutes is effective but may be expensive. Making the website look legit and hosting the malicious content on a subdomain can keep the domain undetectable for a longer period of time. Knowing this, Magnitude creates a list of subdomains for every "main" domain and deletes it from the queue after a short period of time. This helps Magnitude overcome URL listing filtering engines.


Redirect Traffic

Apparently, the road to infection involves many obstacles. The Magnitude exploit kit checks several conditions before trying to exploit the target machine. An attacker that is using Magnitude can define a URL to which a target machine is redirected in case the infection conditions are not met. The URL is also controlled remotely and the system ensures it's up-to-date as shown below:


The system queries the pre-defined redirection URL, which provides the system the information where to redirect the victim, this way the URL can be generated dynamically.

Payload Detection Rate

Testing the detection of payloads by AV products is a very important practice for exploit kits and is commonly used because these products quickly add detection for these payloads. The Magnitude author also uses the Scan4you for testing the payload detection rate:


The second part of the script contains predefined payloads that may be owned by the author itself, these are also constantly updated from a remote server.


Backend Control Panel

On top of the exploit kit infrastructure the author created a control panel for administrators, which allows him to view and modify the configurations of their customers. The administrative control panel, unlike the customer control panel, is accessible only by specific IP addresses that are "hard coded" as part of the control panel. These IP addresses probably are ones used by the authors thus this restriction excludes access from anyone else.


As mentioned in the previous blog post, the customer's control panel is located on a different server. The infection server has to download the payloads from the customer's control panel server. A script was written specifically for this and can only be accessed from this server:


It is evident that the script communicates with the customer's control panel server, downloads the new payload and removes the old one.

The author has definitely learned from the mistakes of other exploit kit authors. The Magnitude exploit kit has been operating for more than a year in the shadows with no information on how it works behind the scenes. Most of the internal scripts can be accessed only from specific IP addresses and are password protected.

We will reveal additional technical information regarding the Magnitude exploit kit backend infrastructure in the next blog post.

Latest SpiderLabs Blogs

Welcome to Adventures in Cybersecurity: The Defender Series

I’m happy to say I’m done chasing Microsoft certifications (AZ104/AZ500/SC100), and as a result, I’ve had the time to put some effort into a blog series that hopefully will entertain and inform you...

Read More

Trustwave SpiderLabs: Insights and Solutions to Defend Educational Institutions Against Cyber Threats

Security teams responsible for defending educational institutions at higher education and primary school levels often find themselves facing harsh lessons from threat actors who exploit the numerous...

Read More

Breakdown of Tycoon Phishing-as-a-Service System

Just weeks after Trustwave SpiderLabs reported on the Greatness phishing-as-a-service (PaaS) framework, SpiderLabs’ Email Security team is tracking another PaaS called Tycoon Group.

Read More