Academy
TermAttack

Web skimming

Web skimming / Magecart

Stealing customers’ card details with code secretly added to the payment pages of e-commerce sites.

Flow

  1. 1The site is compromised
  2. 2Code is injected
  3. 3The card is copied
Related families
—
MITRE ATT&CK
T1059.007 · JavaScript
Sources
4 sources
01

Overview

Magecart is the common name for the groups and technique that inject malicious JavaScript into payment pages. The code copies the card details the customer enters and sends them to the attacker’s server; the payment completes as normal. Sansec

The difference from an infostealer is that the attack targets the merchant’s site rather than the victim’s device; a single site yields the data of thousands of customers. Sansec

02

How it works

  1. 1

    The site is compromised

    Through the admin panel, a plugin vulnerability or a third-party script source. Sansec

  2. 2

    Code is injected

    A short piece of JavaScript is placed on the payment page. MITRE ATT&CK

  3. 3

    The card is copied

    When the form is submitted, the fields are read and sent out. Sansec

03

How to detect it

  • Requests from the payment page to unexpected domains, and changed script files. Sansec
04

What to do

  • Restrict the sources scripts can be loaded from with a content security policy. OWASP
  • Keep the site software and plugins up to date; protect the admin panel with multi-factor authentication. MITRE ATT&CK
05

MITRE ATT&CK

06

Related terms

07

Sources

  1. 1JavaScript (T1059.007) · MITRE ATT&CK
  2. 2What is Magecart? · Sansec
  3. 3Cross Site Scripting Prevention Cheat Sheet · OWASP
  4. 4Update Software (M1051) · MITRE ATT&CK