
A new wave of cyberattacks has targeted WordPress websites. Malicious actors are injecting unauthorized JavaScript into WordPress files to display their own ads instead, redirecting revenue to attacker-controlled AdSense accounts.
Hackers are leveraging trusted platforms such as Google AdSense, an advertising service that allows publishers to display targeted ads for revenue, according to a report by website security firm Sucuri.
Researchers identified distinct AdSense IDs used by attackers, including "pub-9649546719576241" and "pub-7310257338111337."Â
To ensure persistence, injected code was identified in multiple areas of WordPress sites, such as the functions.php file, the wp_options database table, and within plugin directories.
The attack modifies critical files like ads.txt, ensuring continuity even if infected files are detected and removed. The attackers also employ JavaScript to dynamically inject Google advertisements during user interactions with the site, further complicating removal efforts.
At least 17 affected sites have been confirmed with these unauthorized AdSense codes, according to a public tracking database. Since these injections exploit trusted ad platforms, many website owners remain unaware of the malicious activity taking place on their websites.
While the exact method of compromise varies, Sucuri’s analysis highlights several likely entry points:
In other news, attackers were observed manipulating Google Tag Manager’s capabilities for malicious purposes, hiding malware as a legitimate script on a Magento-based eCommerce website, and ultimately exfiltrating checkout data, including payment card details.