Attacco Magecart Hacker

Estimated reading time: 6 minutes

Every day we hear about some new technology threats or vulnerabilities. Lately we talk about the data collection attack known as “Magecart”. Let’s try to understand what it is and how we can do to defend ourselves.

Magecart is a large group of hackers as well as a typical attack that mainly targets online shopping carts. This type of attack has become very common in recent years.

What is the Magecart attack?

Gli hacker di Magecart di solito prendono di mira i negozi online sviluppati con Magento CMS e mirano a rubare le informazioni della carta di credito dei clienti. Questo tipo di attacco è anche conosciuto come supply chain attack, web skimming o e-skimming. Il codice JavaScript iniettato nel sorgente durante l’attacco è solitamente chiamato anch’esso Magecart.

The experts of cyber security noticed this activity of the criminal group in 2010, even though Magecart is become very well known recently. For over 10 years of observation, the Magecart attack has been detected about 2 million times. Since 2010, Magecart is responsible for hacking more than 18,000 hosts. By driving the malicious code, the criminals used 573 domains with about 10,000 download links with Magecart malware.

Today, researchers are reporting a new series of Mageсart attacks. Criminals have changed tactics and automated attacks. Now they are looking for badly set targets to infect the websites and JavaScript files they can reach. Since April 2019, cybercriminals have compromised over 17,000 domains by publishing JavaScript code (also called “ skimmer “) on these websites.

According to Computerweekly , Magecart attacks on online retailers increased by 20% during the COVID-19 pandemics.

Magecart Javascript attack

How the Magecart-attack works

data skimming attacks such as Magecart typically follow a well-established pattern. They must achieve three things to be successful.

1. Go to the site

There are typically two ways attackers gain access to the website and place the skimming code. They can break into your infrastructure or server and put the skimmer there. Or, they’ll go to one of your third-party vendors, especially if they’re an easier target, and infect a third-party tag that will execute a malicious script on your site when invoked in the browser.

2. Collect sensitive information

There are many different ways in which groups can capture data, but the skimming code is almost always a JavaScript script that listens to personal information and collects it. We have seen an approach in which they monitor all keystrokes on a sensitive page or even interception of input in specific parts of a webform such as the credit card and CVV fields . Generally, attackers hide malicious code inside other code, which appears benign, to avoid detection.

3. Send the data to a server

This is the simplest part of the whole process. Once the hackers have access to your website and collect the data they want, the game is over. They can send information from end-user browsers to almost any place on the Internet.

Magecart Card attack

The current state

As we have already mentioned, the Magecart attack is mainly distributed via malicious JavaScript code injected into downloadable plugins or add-ons for Magento online stores. Lately, attackers have started using banner ads to distribute skimmers .

In 2019, during a lightning attack, cybercriminals hacked nearly 1000 e-commerce sites in just 24 hours , proving that they didn’t act manually, but instead used automated tools. Most of the resources affected were small e-shops, although they also include several large companies.

The skimming script was used to steal information from online store visitors, specifically, their bank card details, names, phone numbers and addresses. Then the script records all data entered on payment pages and stores them in the browser until the victim refreshes the page or switches to another tab. The stolen data is then sent to a server controlled by the cybercriminals.

How to deal with the situation

The problem with Magecart is that there is a lot of confusion when it comes to actually protecting these web-based card skimming attacks. For example, auditing of a website on a regular basis cannot stop the attacks, as the problem comes from third party tags, which auditing will not detect.

The advice for IT teams is to take a zero-trust approach with JavaScript on their sites, starting with a policy to block default access to any sensitive information placed in web forms and stored cookies. From there, you only allow a select set of controlled scripts (usually your own) to access sensitive data. And as a result, if this type of skimming code enters the site, it simply cannot access any of the sensitive information.

The advice for IT teams is to take a zero-trust approach with JavaScript on their sites, starting with a policy to block default access to any sensitive information placed in web forms and stored cookies. From there, you only allow a select set of controlled scripts (usually your own) to access sensitive data. And as a result, if this type of skimming code enters the site, it simply cannot access any of the sensitive information.

Magecart Hacker Attack

How to actively protect yourself

To protect your company from Magecart attacks, take a complete inventory of your digital assets using our CTI service . Next, find all possible web and mobile applications, set a security score for each of them, and show which apps are to be fixed and secured. The service can also search the Dark Web, cloud archives and code repositories for all possible data leaks.

The approach adopted is proactive and is based on looking for compromises before they have occurred. This approach, which actively manages the attack surface and scans the dark web, allows for a complete view of the security status of the digital system.

After a complete inventory you can proceed with a Penetration Test to verify the situation and protect your company from any security threats. The Magecart attack, as well as other more modern attack methods that cybercriminals are constantly inventing, can only be countered with this kind of proactive approach, keeping your guard up.

If you have any questions or would like to know how our services can secure your business, please do not hesitate to contact us.

Useful links:

PageSpeed Insight Cover

If the site is slow, you are losing customers. It’s very simple and there are no kinder ways to say the same thing. The speed of a site is directly proportional to the desire of a user to visit it. To measure your portal you can use a tool made available by Google: PageSpeed Insight. You can access this service from the Plesk control panel offered by SOD, simply by clicking on the icon at the bottom of the site panel.


Page Speed Insight Panel


Today we try to understand how this tool can help us improve the user experience on our site and also the positioning for search engines (SEO). In this regard, I recommend checking the data of a research carried out by Backlinko in which they tested how different on-site and off-site parameters affect positioning, the search is in English but has also been translated into Italian.

Why is speed important?

The speed of your website has a direct impact on SEO and conversion rates. Not taking the time to make improvements can be a costly mistake. Users are much more likely to leave a slow website without even visiting it, and the likelihood of this happening increases by over 100% if a page’s load time goes from 1s to 6s. In particular, the bouncing rate (percentage of users who leave without visiting other pages) is in the following parameters:

– Loading up to 3 seconds: bouncing rate + 32%

– Loading up to 5 seconds: bouncing rate + 90%

– Up to 6 seconds: bouncing rate + 106%

There is a real need for speed, and Google’s free PageSpeed Insights tool is a fantastic resource to help you find and fix problems that could slow down your site.

What is PageSpeed Insight

PageSpeed Insights is a free tool offered by Google to help analyze the performance of a website and receive suggestions on how to improve it. In fact, it’s probably the most popular page speed analysis tool out there, so it’s worth learning how to use.

PageSpeed provides a speed index in cents, the maximum of which is obviously 100/100. Before you rush to figure out how to get that score, you need to know how to use the tool correctly and implement the suggestions it provides. In fact, not only is a score produced, but also the weak points that affect the score, loading times and suggestions for improving it are shown.

Let’s see some useful information to better understand how PageSpeed Insight works.

PageSpeed and loading time

The PageSpeed Insight tool does not measure the loading time of your site. Despite what people think. To understand what that means, let’s see the difference between PageSpeed and page load time.


PageSpeed is the score given by Google with its PageSpeed Insights tool. This tool takes the raw performance metrics and converts them to a score between 1 and 100. While it will offer diagnostic reporting and opportunities as part of the report, they do not directly contribute to the performance score.

This means that PageSpeed Insight alone is not actually a real indicator of a site’s loading time.

Loading time

So what is loading time compared to PageSpeed? It is the average time it takes a page to be loaded by a user. It is not a calculated score, it is the actual loading time of a page, in seconds or milliseconds, between the beginning and the end of the content loading.

Of course, the loading time alone does not give an idea of what is causing speed problems or how to fix them.

How does the tool work?

Once you have accessed the tool from the hosting control panel, you will find us in front of a lot of information.

The Google PagesSpeed Insights tool provides both lab data and field data for each page. Lab data is collected in a controlled environment when a page is scanned and is a great way to identify performance problems and find solutions to solve them. Field data, on the other hand, is collected from real-world performance data when users load the page. Some of the problems and obvious bottlenecks that make conversion more difficult for real visitors may arise here.

In short: the tool shows a performance score out of a total of 100. However, the performance metric results used to calculate it are not weighted equally. Things like “first contentful paint” (the first time you see something on the screen) have a greater effect.

There are particular data that have different influences on the final score shown in hundredths. To find out what to improve to increase your PageSpeed score, you need to analyze the sections that contain page-specific data.

The sections

In practice, the screen displayed in the control panel first of all shows a table showing the loaded resources and their size. Next there are the “Lab Data”, “Load Opportunities” and “Diagnostic” sections.

Each section lists all the tests that have been passed, those that need to be improved and those that show problems. It is all shown with a color-code which helps to immediately pinpoint where the problems are.

Page Speed Insight DiagnosticsJust click on the “Details” button to get more information and check what is wrong.


The tool is offered free of charge and provides important data for webmasters who want to monetize the site and pay attention to conversions. Each item on the list is accompanied by a link that provides further information on that specific topic.

Improving a certain aspect of your site will be much easier, having clues on how to proceed. Especially if you make sales on the site, if you try to convert your visitors, the speed of the pages is a parameter to work on carefully to optimize it as much as possible.

The control panel of the SOD web hosting service natively offers this opportunity to analyze the site, conveniently without having to go to other pages. Try the service before purchasing and personally check the convenience of the hosting control panel.

Useful links: