Dataleaks

Juspay Databases Containing 10 Crore Users’ Data for Sale on Data Sharing Platform

 

Category
Adversary Intelligence – Data Leak
Impacted Assets
Customer Records
CloudSEK Verified
Yes
Leaked Data
Customer PII (name, phone number, email address), masked Credit Card data (first 4 and last 4 digits of the 16 digit card number)

 

The Threat

Inc42 published a report regarding Juspay data being leaked on the dark web. The report claims that the data dump contains PII (Personally Identifiable Information) and card data of 10 Crore users. CloudSEK has done a detailed analysis of this incident and the key findings are summarized below.

Overview
  • Juspay had a security breach in August 2020 when a group of hackers hacked into their Payment MetaData servers and downloaded a few databases. 
  • Juspay did not disclose this incident to authorities – rather concealed the breach. 
  • In January 2021, Inc42 reported that Juspay was beached and its customers’ PII information was leaked on the dark web. 
  • The databases contain 16 fields including masked card data and PII (email address, first and last name, mobile numbers), among other sensitive information. 
Impact
  • The leaked data does not contain full card data – it mainly exposes users’ PII along with masked card data.
  • There is no direct impact on other banks as the card numbers are masked, i.e. only the first 4 and last 4 numbers are visible.
  • It is impossible to reverse engineer or brute force card numbers because card issuers (Visa, MasterCard, Rupay) block an invalid card after 100 failed attempts. 
  • The PII can be used to carry out social engineering attacks on the affected users.
  • The direct impact of this leak is negligible for banks and other organizations as full card data was not compromised and the chances of retrieving full data from partial data is impossible. 
Advice to Security Teams
  • We will see increased targeted phishing attacks on card users in the coming months. 
  • In case of a successful phishing attack – banks are advised to keep a close watch on credit cards that have been through JusPay gateway using internal fraud monitoring technologies. 

 

Detailed Technical Analysis

CloudSEK’s flagship digital risk monitoring platform XVigil discovered a post on a data sharing platform, selling user databases of multiple companies. Our Threat Intelligence researchers did a detailed analysis on the same. The companies affected are:

Juspay.in   Teespring.com 
MyON.com  Knockcrm.com 
Mindful.org Clickindia.com 
Chqbook.com   Bigbasket.com 
Reddoorz.com    Hybris.com (SAP.com) 
Wedmegood.com  Wongnai.com
Geekie.com.br    Anyvan.com
Accuradio.com Everything5pounds.com 
Cermati.com Netlog.com (Twoo.com) 
Reverbnation.com Fotolog.com 
Pizap.com ModaOperandi.com 
Eventials.com Wahoofitness.com 
Sitepoint.com Singlesnet.com

 

Impacted Assets

The most recent post contains a sample of the Juspay database though the data has not been validated. Here are some sample screenshots from the leak:

Schema 1

 

Schema1

 

The “stored_card” database contains the following fields:

  •   id varchar
  •   version bigint
  •   card_brand
  •   card_exp_month
  •   card_exp_year
  •   card_fingerprint
  •   card_isin
  •   card_issuer
  •   card_last_four_digits
  •   card_reference
  •   card_token
  •   card_token_of_vault_provider
  •   card_type
  •   customer_id
  •   date_created
  •   last_updated
  •   masked_card_number
  •   merchant_account_id
  •   name_on_card
  •   nickname
  •   vault_provider
  •   card_global_fingerprint
Schema 2

 

Schema2

 

The “customer” database contains the following fields:

  •   id
  •   version
  •   date_created
  •   email_address
  •   first_name
  •   last_name
  •   last_updated
  •   merchant_account_id
  •   mobile_country_code
  •   mobile_number
  •   object_reference_id

 

Threat Actor

The threat actor joined the forum in December 2020. And since then, the threat actor has shared 2 posts, attempting to sell databases from their private collection. 

One of the posts advertises multiple databases while the other post is selling the Gympass database.

MA&RE

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.

 

MA&RE : The Race Horse of Threat Intelligence

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:

  • Indicators of Compromise (IoCs): URLs/ Domains/ C2-IP
  • Evasion techniques
  • Infecting mechanisms
  • Use of zero-day exploits/ vulnerabilities
  • Lateral movement and compromise

In this post, we explore the process of Malware Analysis and Reverse Engineering (MA&RE) by analysing Magecart’s skimming malware.

 

The Rise of Magecart 

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: 

  • Compromise the website or the web-server itself through:
    • Brute force login attempts 
    • Phishing attacks
    • Social engineering
    • Exploiting known software vulnerabilities
  • Carry out supply chain attacks and compromise third-party tools that the website uses: Since third-party tools have several clients, compromising one such tool would mean that all the websites using this tool can be compromised. For instance, if a threat actor compromises a third-party eCommerce platform like Magento, the thousands of retailers that engage in business with them are also exposed to an attack. 

 

Magecart’s Modus Operandi

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:

  • They then sell the stolen cards on dark web marketplaces or
  •  Use the compromised cards to carry out other fraudulent schemes.

 

Dissecting a Skimmer 

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.

Image1 - encoded dataTokens MA&RE
Image1 – Encoded dataTokens

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.

Image2 - shifting function for the dataToken array
Image2 – Shifting function for the dataToken array

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.

MA&RE Image3 - decoding function
Image3 – Decoding function

 

MA&RE Image4 - decoded dataTokens
Image4 – Decoded dataTokens

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.

MA&RE Image5 - Ready function
Image5 – Ready 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.

MA&RE Image6 - The list of data to be skimmed
Image6 – The list of data to be skimmed

After extracting the data, it is saved in local storage, and is then converted to JSON string and sent to the attacker.

Image7 - encrypting the data section
Image7 – Encrypting the data section

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.

Image8 - The public key that encrypt the data
Image8 – The public key that encrypt the data


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.

Image9 - Sending data section
Image9 – Sending data section


Conclusion

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.