🚀 CloudSEK has raised $19M Series B1 Round – Powering the Future of Predictive Cybersecurity
Read More
Protect your organization from external threats like data leaks, brand threats, dark web originated threats and more. Schedule a demo today!
Schedule a Demo
Attacks that involve malware are one of the most prevalent threats on the internet. Malware is a malicious piece of code that infiltrates a computer and disrupts operations. Attackers develop malicious software and tailor them to serve specific purposes such as key logging, hijacking, phishing, etc., while targeting businesses or individuals across various sectors. Gathering insights into the properties and traits of such malware can help mitigate security threats to organizations and improve its security posture.
Malware Analysis and Reverse Engineering (MA&RE) allows incident responders to extract threat intelligence from malware samples to obtain information regarding the malware and the threat group responsible. MA&RE will help us detect, under layers of obfuscation created by actors to throw researchers off their tracks, the logic behind the malware by analysing the actual working code written by the threat actor themselves.
The following threat intelligence can be obtained with the help of MA&RE:
In this post, we explore the process of Malware Analysis and Reverse Engineering (MA&RE) by analysing Magecart’s skimming malware.
Magecart is a hacking group that targets shopping cart tools and systems to steal payment information from customers. Shopping carts are easy targets for skimming attacks as it is quite convenient for threat actors to compromise these payment pages and siphon payment (card) details and other sensitive information from users.Â
A web skimmer is a malware written in JavaScript that attackers leverage by injecting them onto targeted websites to:Â
Client-side web skimming attacks are launched by the unsuspecting victims themselves. Once the attacker gains access to the website and places Magecart’s skimming code in it, the code searches for a checkout page and adds listeners to the submit button of the payment form. Then, when the customer clicks the submit button to send their card details and other information to initiate the payment, the malcode skims the entered data and sends it directly to the attacker’s server.Â
Magecart attackers use different ways and methods to spread the infection and to prevent detection. Some of the techniques used to achieve this is by encrypting the content of the code, such as strings, using Base64 algorithm, and also by obfuscating the malicious code before publishing it.
Once the attackers bypass security systems and successfully skim the payment page:
In this section we explore how to analyse a skimmer malware with Magecart malware as our sample.
Firstly, the malicious code is injected onto a legitimate paying form and once the page is loaded and the client initiates interaction, the code is activated on the client’s side. The code is usually obfuscated to avoid detection.
1. The first layer of the Magecart pattern holds a set of dataTokens which contains all the strings related to the code implementation. In some cases the data will be encoded using the Base64 algorithm.
Magecart uses heavy obfuscation techniques to hide the skimmer malware. To accomplish this, the items in the array are shifted 5 times, rotating these elements to the right. This process also enables the malicious code.
2. Once the array is shifted, the dataToken is decrypted to get the original data. The code uses the dtoa() function to modify the data decoded by the Base64 algorithm to plain text.
In Image4 we can see the decoded dataToken.
3. The final layer of Magecart’s malicious code serves two functions. Its first function is to search for html tags that hold specific ID values or class values, in which the data is entered. One of the targeted tags is ‘buttons’, to which the malicious code adds an event listener. And once the customer clicks on the button, the listener captures all the card details entered on the page. Image5 depicts this function.
The second function is responsible for dumping credit card details, which usually includes card number, CVV, and card holder’s first name and last name. Image6 shows the list of information that the malicious code extracts or skims.
After extracting the data, it is saved in local storage, and is then converted to JSON string and sent to the attacker.
However, before sending the data, it is encrypted using an asymmetric encryption algorithm with a hardcoded public key using the JSEncrypt() function. The encrypted data is then sent to the threat actor.
In this Magecart sample, the code is executed once the page is loaded. It activates the targeted button at first, followed by the data dump function.
Threat actors have different ways to conceal their existence and obfuscate the malicious code they use in their campaigns, rendering its detection almost impossible. This could allow supply chain attacks to skyrocket, targeting thousands of eCommerce platforms that subscribe to the same third-party. In the field of threat intelligence research, Malware Analysis and Reverse Engineering (MA&RE) enables researchers to analyse and record various sophisticated tactics employed by a malware, to form actionable intelligence which can be then used to fortify businesses and individuals from such offensives.
Explore the escalating wave of cyber threats on platforms like Google Groups and Usenet, uncovering the pivotal role of cybersecurity in safeguarding online discussion forums.
Threat actors have been abusing advertisement services to serve malware to users and redirect traffic to websites purchasing services from them.
A detailed blog on Analysis of the Global Malware Trend: Exploiting Undocumented OAuth2 Functionality to Regenerate Google Service Cookies Regardless of IP or Password Reset.
Take action now
CloudSEK Platform is a no-code platform that powers our products with predictive threat analytic capabilities.
Digital Risk Protection platform which gives Initial Attack Vector Protection for employees and customers.
Software and Supply chain Monitoring providing Initial Attack Vector Protection for Software Supply Chain risks.
Creates a blueprint of an organization's external attack surface including the core infrastructure and the software components.
Instant Security Score for any Android Mobile App on your phone. Search for any app to get an instant risk score.
min read
Malware Analysis and Reverse Engineering: Analysing Magecart Skimmer
Attacks that involve malware are one of the most prevalent threats on the internet. Malware is a malicious piece of code that infiltrates a computer and disrupts operations. Attackers develop malicious software and tailor them to serve specific purposes such as key logging, hijacking, phishing, etc., while targeting businesses or individuals across various sectors. Gathering insights into the properties and traits of such malware can help mitigate security threats to organizations and improve its security posture.
Malware Analysis and Reverse Engineering (MA&RE) allows incident responders to extract threat intelligence from malware samples to obtain information regarding the malware and the threat group responsible. MA&RE will help us detect, under layers of obfuscation created by actors to throw researchers off their tracks, the logic behind the malware by analysing the actual working code written by the threat actor themselves.
The following threat intelligence can be obtained with the help of MA&RE:
In this post, we explore the process of Malware Analysis and Reverse Engineering (MA&RE) by analysing Magecart’s skimming malware.
Magecart is a hacking group that targets shopping cart tools and systems to steal payment information from customers. Shopping carts are easy targets for skimming attacks as it is quite convenient for threat actors to compromise these payment pages and siphon payment (card) details and other sensitive information from users.Â
A web skimmer is a malware written in JavaScript that attackers leverage by injecting them onto targeted websites to:Â
Client-side web skimming attacks are launched by the unsuspecting victims themselves. Once the attacker gains access to the website and places Magecart’s skimming code in it, the code searches for a checkout page and adds listeners to the submit button of the payment form. Then, when the customer clicks the submit button to send their card details and other information to initiate the payment, the malcode skims the entered data and sends it directly to the attacker’s server.Â
Magecart attackers use different ways and methods to spread the infection and to prevent detection. Some of the techniques used to achieve this is by encrypting the content of the code, such as strings, using Base64 algorithm, and also by obfuscating the malicious code before publishing it.
Once the attackers bypass security systems and successfully skim the payment page:
In this section we explore how to analyse a skimmer malware with Magecart malware as our sample.
Firstly, the malicious code is injected onto a legitimate paying form and once the page is loaded and the client initiates interaction, the code is activated on the client’s side. The code is usually obfuscated to avoid detection.
1. The first layer of the Magecart pattern holds a set of dataTokens which contains all the strings related to the code implementation. In some cases the data will be encoded using the Base64 algorithm.
Magecart uses heavy obfuscation techniques to hide the skimmer malware. To accomplish this, the items in the array are shifted 5 times, rotating these elements to the right. This process also enables the malicious code.
2. Once the array is shifted, the dataToken is decrypted to get the original data. The code uses the dtoa() function to modify the data decoded by the Base64 algorithm to plain text.
In Image4 we can see the decoded dataToken.
3. The final layer of Magecart’s malicious code serves two functions. Its first function is to search for html tags that hold specific ID values or class values, in which the data is entered. One of the targeted tags is ‘buttons’, to which the malicious code adds an event listener. And once the customer clicks on the button, the listener captures all the card details entered on the page. Image5 depicts this function.
The second function is responsible for dumping credit card details, which usually includes card number, CVV, and card holder’s first name and last name. Image6 shows the list of information that the malicious code extracts or skims.
After extracting the data, it is saved in local storage, and is then converted to JSON string and sent to the attacker.
However, before sending the data, it is encrypted using an asymmetric encryption algorithm with a hardcoded public key using the JSEncrypt() function. The encrypted data is then sent to the threat actor.
In this Magecart sample, the code is executed once the page is loaded. It activates the targeted button at first, followed by the data dump function.
Threat actors have different ways to conceal their existence and obfuscate the malicious code they use in their campaigns, rendering its detection almost impossible. This could allow supply chain attacks to skyrocket, targeting thousands of eCommerce platforms that subscribe to the same third-party. In the field of threat intelligence research, Malware Analysis and Reverse Engineering (MA&RE) enables researchers to analyse and record various sophisticated tactics employed by a malware, to form actionable intelligence which can be then used to fortify businesses and individuals from such offensives.