Academy
TermMalware type

JavaScript-based stealers

Malicious code written in JavaScript that steals data by running in the browser, in Node.js or inside an Electron application.

Flow

  1. 1Packaged
  2. 2Runs
  3. 3Sends
Related families
—
MITRE ATT&CK
T1059.007 · JavaScript
Sources
5 sources
01

Overview

JavaScript appears in two forms: scripts added to payment pages that copy forms, and infostealers packaged with Node.js and Electron and distributed like desktop applications. MITRE ATT&CK

Electron applications contain large, legitimate files, which makes them suitable for hiding malicious code; file scanners can easily miss a small script inside a package of hundreds of megabytes.

02

How it works

  1. 1

    Packaged

    The code is embedded in a desktop application that looks like a game or tool. MITRE ATT&CK

  2. 2

    Runs

    The Node.js runtime accesses browser files and the system directly. MITRE ATT&CK

  3. 3

    Sends

    Data is usually sent via a webhook or a Telegram bot. MITRE ATT&CK

03

Real-world examples

JavaScript on payment pages

Sansec describes how JavaScript code added to payment pages in Magecart attacks copies card details and sends them to the attacker. Sansec

04

How to detect it

  • A Node.js or Electron process accessing browser profile folders. MITRE ATT&CK
05

What to do

  • Allow only approved Electron applications to run with application control. MITRE ATT&CK
06

MITRE ATT&CK

07

Related terms

08

Sources

  1. 1JavaScript (T1059.007) · MITRE ATT&CK
  2. 2Masquerading (T1036) · MITRE ATT&CK
  3. 3Exfiltration Over Web Service (T1567) · MITRE ATT&CK
  4. 4What is Magecart? · Sansec
  5. 5Behavior Prevention on Endpoint (M1040) · MITRE ATT&CK