credit-skimmer-MoeSec

Credit Card Skimmer Targeting eCommerce Websites using Magento, WooCommerce and OpenCart: Analysis and Mitigation

Recently, the eCommerce sector has been increasingly targeted by cybercriminals who employ sophisticated techniques to steal sensitive customer information. This article analyzes a specific skimmer affecting Magento, WooCommerce, and OpenCart based websites, deciphers its malicious code, discusses how it operates, and provides steps for remediation and protection.

Analysis of Malicious JavaScript Code

The Malicious Code

Credit card skimmer

Understanding the Code

  1. Obfuscation: The array keb and the constant oem are used to obfuscate the actual URL of the WebSocket server.
  2. Decryption: The URL is decrypted using the XOR operation (lebh ^ oem), a common obfuscation technique.
  3. WebSocket Connection: A WebSocket connection is established to the decrypted URL, appending the current page URL as a parameter.
  4. Execution of Malicious Code: The WebSocket listens for messages from the server and executes the received data as JavaScript code.

Decoding the URL

To decode the WebSocket URL:

Decoding clearnetfab.net-skimmer-decode

Running the above code on an isolated VM results in the URL being revealed which is wss://clearnetfab[.]net/common in this case. As explained above, The malicious code connects and sends the address of the compromised URL to clearnetfab[.]net and listens for a response back with another JavaScript code intended to steal credit card and other sensitive information.

We saw over 10 variants of this malicious code so far. Other malicious domains includes:

cpeciadogfoods[.]com
lererikal[.]org
iconstaff[.]top
trazozu[.]cc
cloudflare-stat[.]net
clearnetfab[.]net
amocha[.]xyz

Where Malicious Code is Found

Malicious JavaScript like this can be injected into website files in various ways:

  • Direct File Injection: Hackers may gain access to the server and inject the script directly into HTML, JavaScript, or PHP files.
  • Database Injection: The code can be injected into the database, causing it to be rendered on the frontend when certain pages are loaded.
  • Third-Party Integrations: Vulnerabilities in third-party plugins, themes, or extensions can be exploited to introduce malicious scripts.

Cleaning the Infection

Step-by-Step Cleanup

  1. Identify and Remove Malicious Code:

  2. Change Credentials:

    • Update all administrative passwords and database credentials.
    • Ensure the use of strong, unique passwords.
  3. Apply Security Patches:

    • Update your CMS (Magento, WooCommerce, OpenCart) and all plugins/extensions to the latest versions.
  4. Scan for Backdoors:

    • Ensure there are no hidden backdoors left by the attacker.

For detailed and professional cleanup, consider using our MoeSec.com Website Security and Malware Removal.

Protecting Against Future Threats

Implementing Security Measures

  1. Website Firewall Protection:

  2. Regular Security Audits:

    • Conduct regular security audits to identify and fix vulnerabilities.
  3. File Integrity Monitoring:

  4. Secure Development Practices:

    • Follow secure coding practices to minimize vulnerabilities.
  5. Backup Regularly:

    • Maintain regular backups to ensure quick recovery in case of an attack.

Conclusion

Credit card skimmers pose a significant threat to eCommerce websites, compromising both business integrity and customer trust. Understanding and mitigating these threats through diligent analysis, cleanup, and preventive measures is crucial. Leveraging professional services like those offered by MoeSec.com can help ensure robust protection and swift recovery from such incidents.

Special Offer

 
ULTIMATE SALE
-15%

Use Promocode: Welcome15 at Checkout