Trustwave SpiderLabs Exposes Unique Cybersecurity Threats in the Public Sector. Learn More

Trustwave SpiderLabs Exposes Unique Cybersecurity Threats in the Public Sector. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Anyone Can Check for Magecart with Just the Browser

In the past, there have been plenty of articles and blog posts recommending the use of Content Security Policy (CSP) and Sub Resource Integrity (SRI) to prevent the insidious skimming malware from taking hold of a website. However, what can a small business owner do if resources are limited and implementing these countermeasures is just not feasible? What can a normal everyday user do to check and see if their favorite shopping site is compromised? In this blog post, I will go over a few steps that don’t require any security training to perform.

Step 1 – Scan with urlscan.io

Image001

 

 

Put in the URL or hostname that you want to check, then run the Public Scan. Here’s what I got when I put in bumperworksonline.com:

Image002

 

The part we want to look at is in the lower left corner where the Domain & IP information is located.

Image003

 

This section shows all the IPs and domains of all the requests performed on this website. We see that most of the requests are from the same domain as the site (ASMALLORANGE) and there are some from Google and Facebook. However, there is one that we don’t recognize. This could simply be an externally loaded ad or resource, but we’ll need to dig deeper to find out.

Image004

 

Step 2 – Checking the scripts

Clicking over to the IP Detail tab shows us that the request is from the domain, scriptvault.org, located in France. Let’s take a look at what exactly was getting loaded on the site by click on the HTTP tab on top. To the right of the HTTP tab are filters for various file types. Click on Script to view only Javascript files.

Image005

 

At the bottom, we see that the file loaded is ‘bumperworksonline.js’. In normal circumstances, this script file would be loaded from the same domain as all the other script files.  This is a big red flag. Clicking on Show Response, we see an obfuscated Magecart script.

So, now that we’ve found the skimming script, we’re done here, right? Not so fast. The skimmers can hide in other existing files as well. Take this normal looking credit card validation script for example:

Image006

 

Even though the file is served by the same host as the website itself it can still be compromised. If we view the response and scroll down, we see yet another skimmer script.

Those who have read the Fortinet blog should recognize the skimmer as Inter. It is a common kit that is highly customizable and sold in the underground. Fortunately for us, this version of it is typically not obfuscated at all and provides some useful information. As further evidence that this script is malicious, we can look into the ‘Gate’ field which contains the exfiltration URL.

Image007

 

Step 3 – Lookup the exfiltration URL

Now we just take the IP/domain and do a WHOIS lookup. Any of the online WHOIS sites will do. Here is what I got from whois.domaintools.com:

Image008

 

Looks like the credit card numbers are going to a server in Hong Kong. As for the other script, all we need to do is take the decoder function and run it to see the decoded strings. We can use repl.it to do this and here is the result:

Screen Shot 2019-11-26 at 5.30.15 PM

 

On the right, we can see the exfiltration URL as ‘https://scriptvault.org/tr/’.

 

Conclusion

Throughout my research, I’ve seen many skimming domains get taken down. However, it is ultimately a game of whack-a-mole because new domains get created all the time. The only reliable way of preventing Magecart is to detect, fix, and harden the security of websites. There are currently a few tools online that can help with these three steps:

 

Detect/Fix

Harden

 

I hope that by providing a simple means of detecting it, more people can take action and do what is necessary to stop Magecart.

 

Additional Reading

Magecart - An Overview and Defense Mechanisms
Digging Deep Into MageCart Malware
Digging Deep Into MageCart Malware Part II

 

Latest SpiderLabs Blogs

Important Security Defenses to Help Your CISO Sleep at Night

This is Part 13 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

2024 Public Sector Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies

Trustwave SpiderLabs’ 2024 Public Sector Threat Landscape: Trustwave Threat Intelligence Briefing and Mitigation Strategies report details the security issues facing public sector security teams as...

Read More

How to Create the Asset Inventory You Probably Don't Have

This is Part 12 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More