Magecart: How Its Attack Techniques EvolvedMagecart: How Its Attack Techniques Evolved
Shape-shifting Magecart has shown itself to be highly adaptable in its ability to compromise third-party websites, especially during the pandemic.
Web-based cyberattacks against businesses of all sizes are on the rise. Magecart, the association of global hacking groups responsible for some of the biggest client-side data breaches in recent years, is currently the most notorious of these threats.
The modus operandi of Magecart is to compromise a third-party piece of software on a retail website, like shopping carts, checkout pages, or payment pages to steal customer data. Magecart skimmers have been detected on over 2 million global websites, and the incidence of such attacks increased by over 20% in the early days of the pandemic In the aftermath of numerous high-profile attacks on prominent e-commerce websites, we dissected these attack techniques and how they’ve evolved over the years:
Direct Supply-Chain Compromise
Supply chain compromise is a hallmark of a Magecart attack. This type of attack made headlines in the case of British Airways, Ticketmaster, and Newegg back in 2018. It’s typically executed by inserting skimming code as third-party code on the website. In most cases, methods like credential theft, SQL injection, RDP attacks, and others can be used to gain access to a third-party’s servers to inject malicious code. The code is designed to evade detection and the attacker is able to steal sensitive customer data such as payment and login information from website visitors.
More Skimming & Scamming
Credit card skimmers have also injected PayPal iframes to compromise the checkout process and collect sensitive payment information from checkout pages on vulnerable websites.
Card Skimming Scripts in Favicons
This type of skimmer was first detected on several online stores running the WooCommerce WordPress plug-in in the latter half of 2020. Magecart groups used metadata of image files to hide malicious payloads in order to steal valuable payment information entered by website users. The metadata for an image file or EXIF file usually contains information regarding the date, time, location, resolution, and other camera-related details. In some cases, attackers used the copyright field of an image file to conceal malicious code.
Another technique used by hackers is to insert malware into websites through a PHP-based shell disguised as a favicon. This is done by altering the shortcut icon tags in the HTML code so that it references the malicious image file. The Web shell can then be made to run malicious credit card skimming payloads from external domains.
Taking Advantage of End-of-Life E-commerce Versions
Ant & Cockroach Skimmer
This is the most commonly used technique by Magecart groups. The attack usually involves the following:
Distinct “loader” and “skimmer” code.
Regex checks to target URLs linked to checkout pages with developer tools disabled.
“Radix” obfuscation technique to disguise the skimming code.
The hackers also usually make slight tweaks to the malicious payload. Magecart Group 12 has recently also been linked to the insertion of cryptocurrency mining code on compromised websites.
Magecart attacks have gotten more sophisticated and elusive to track, and e-commerce businesses are facing increasing pressure to safeguard their websites against these threats. With the holiday season looming, websites are more prone than ever to coordinated campaigns executed by these attackers. The good news is that there are many solutions available in the market to detect or protect against these attacks, and organizations must make it a priority to include Magecart prevention in their security strategy.
About the Author(s)
Hacking Your Digital Identity: How Cybercriminals Can and Will Get Around Your Authentication MethodsOct 26, 2023
Modern Supply Chain Security: Integrated, Interconnected, and Context-DrivenNov 06, 2023
How to Combat the Latest Cloud Security ThreatsNov 06, 2023
Reducing Cyber Risk in Enterprise Email Systems: It's Not Just Spam and PhishingNov 01, 2023
SecOps & DevSecOps in the CloudNov 06, 2023
9 Traits You Need to Succeed as a Cybersecurity Leader
The Ultimate Guide to the CISSP
Gone Phishing: How to Defend Against Persistent Phishing Attempts Targeting Your Organization
The Evolving Ransomware Threat: What Business Leaders Should Know About Data Leakage
The Rise of Extended Detection & Response