Breaking News

Magecart campaign abuses legitimate sites to host web skimmers and act as C2

A new ongoing Magecart web skimmer campaign abuse legitimate websites to act as makeshift command and control (C2) servers.

Akamai researchers discovered a new ongoing Magecart web skimmer campaign aimed at stealing personally identifiable information (PII) and credit card information from users in North America, Latin America, and Europe.

Magecart attacks target e-commerce websites, the name “Magecart” is derived from the malicious code (JavaScript) typically injected by the attackers into compromised websites.

In the recent campaign uncovered by Akamai, threat actors hijack legitimate websites to act as makeshift C2 servers and use them to distribute malware.

“Attackers employ a number of evasion techniques during the campaign, including obfuscating Base64 and masking the attack to resemble popular third-party services, such as Google Analytics or Google Tag Manager.” reads the analysis published by Akamai.

Some of the victim organizations have hundreds of thousands of visitors per month, this implies that their compromise impacted up to tens of thousands of victims. The researchers pointed out that many victims uncovered the attack more than a month after the initial compromise.

The attack chain commences by scanning the web for vulnerable legitimate sites and hacking them to inject malicious code. Attackers used the compromised websites as C2 servers to avoid detection.

“Rather than using the attackers’ own C2 server to host malicious code, which may be flagged as a malicious domain, attackers hack into (using vulnerabilities or any other means at their disposal) a vulnerable, legitimate site, such as a small or medium-sized retail website, and stash their code within it.” continues the analysis. “In this way, the attackers create a seemingly healthy host for their malicious code, and can deliver it to any victim they choose.”

Attackers employ small JavaScript code snippets that act as loaders to fetch the final software skimmer from the victims’ websites previously compromised.

Threat actors likely compromised the websites by exploiting known vulnerabilities in popular CMS (such as Magento, WooCommerce, WordPress, Shopify, etc.) or in vulnerable third-party services and components used by the website.

The researchers identified two distinct variations of the skimmer code employed in this ongoing campaign. 

The first skimmer code is a heavily obfuscated version that contains a list of CSS selectors which explicitly indicated that the skimmer targeted input fields responsible for capturing PII and credit card details.

The second variation of the skimmer was comparatively less obscured, enabling Akamai researchers to gauge the scope of this campaign by analyzing the indicators present in the code.

Once stolen the data, attackers exfiltrate them through a straightforward HTTP request that is initiated by creating an IMG tag within the software skimmer. The stolen data is then appended to the request as query parameters, encoded as a Base64 string.

“The primary solution for effectively combating web skimming lies in the utilization of tools and technologies that provide behavioral and anomaly detection” concludes the report. “Traditional static analysis tools prove inadequate in countering web skimmers, as they continually modify their methods and employ increasingly sophisticated techniques that can evade static analysis.”

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

Pierluigi Paganini

(SecurityAffairs – hacking, Magecart)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

SECURITY AFFAIRS MALWARE NEWSLETTER ROUND 84

Security Affairs Malware newsletter includes a collection of the best articles and research on malware…

16 minutes ago

Security Affairs newsletter Round 563 by Pierluigi Paganini – INTERNATIONAL EDITION

A new round of the weekly Security Affairs newsletter has arrived! Every week, the best…

48 minutes ago

Fintech firm Figure disclosed data breach after employee phishing attack

Fintech firm Figure confirmed a data breach after hackers used social engineering to trick an…

21 hours ago

U.S. CISA adds a flaw in BeyondTrust RS and PRA to its Known Exploited Vulnerabilities catalog

The U.S. Cybersecurity and Infrastructure Security Agency (CISA) adds a flaw in BeyondTrust RS and…

22 hours ago

Suspected Russian hackers deploy CANFAIL malware against Ukraine

A new alleged Russia-linked APT group targeted Ukrainian defense, government, and energy groups, with CANFAIL…

1 day ago

New threat actor UAT-9921 deploys VoidLink against enterprise sectors

A new threat actor, UAT-9921, uses the modular VoidLink framework to target technology and financial…

2 days ago

This website uses cookies.