Connect with us

Hi, what are you looking for?


Malware & Threats

Hacked WordPress Sites Target Random Users

Malicious actors have compromised thousands of WordPress websites and are randomly redirecting their visitors to sites that host malware and scams.

Malicious actors have compromised thousands of WordPress websites and are randomly redirecting their visitors to sites that host malware and scams.

According to Sucuri, attackers injected 10-12 lines of malicious code into the header.php file of the WordPress theme. The code checks the user agent and if the visitor is not a crawler, they are taken to various types of malicious websites via a redirect chain that involves the default7(dot)com, test246(dot)com, test0(dot)com, distinctfestive(dot)com and ableoccassion(dot)com domains.

Interestingly, not all users are redirected to malicious websites. The code injected into WordPress websites is designed for random redirects, with a 15 percent chance of a user being redirected. The attack sites also set a cookie to track returning visitors.

If the hacked website is accessed via Internet Explorer, the redirect chain is different and the user is served a malware downloader disguised as a Java or Flash update. Jérôme Segura, lead malware intelligence analyst at Malwarebytes, reported seeing tech support scam websites delivered via this attack.

A bug in the malicious code causes PHP to display the following notice: “Undefined index: 6FoNxbvo73BHOjhxokW3.” Searching for this string on Google returns more than 6,000 results — although the actual number of compromised websites is likely much higher considering that PHP notices are disabled on many servers.

Searching for this string on Google revealed that the malicious code had also been injected into the footer.php file of WordPress websites. The attackers appear to have switched to targeting the header.php file in April, but researchers discovered that the footer.php injections were more sophisticated as the malicious code was designed not only to redirect visitors, but also to push pop-ups, and the redirect URL could be easily updated by the attacker by sending a request to the infected website.

“In most cases, the infected sites had multiple vulnerabilities. The infection itself was part of a number of other infections in the environment (it wasn’t an isolated event). In some cases, the infection was the only infection and found within the active theme’s header.php file. This is a typical infection scenario when attackers have access to WordPress admin interface and can edit the current theme’s files directly from there,” explained Denis Sinegubko, senior malware researcher at Sucuri.

It’s worth noting that the same malicious code has been injected into the administrator/includes/help.php file of some Joomla websites, but there only appear to be a handful of affected sites.

Advertisement. Scroll to continue reading.

Last month, IBM Security warned WordPress website owners about an increase in attacks involving the C99 webshell. The company reported seeing nearly 1,000 attacks in February and March.

Related Reading: WordPress Sites Used to Power Layer 7 DDoS Attacks

Related Reading: Backdoor in WordPress Plugin Steals Admin Credentials

Written By

Eduard Kovacs (@EduardKovacs) is a managing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join us as we delve into the transformative potential of AI, predictive ChatGPT-like tools and automation to detect and defend against cyberattacks.


As cybersecurity breaches and incidents escalate, the cyber insurance ecosystem is undergoing rapid and transformational change.


Expert Insights

Related Content


The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.


A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...

Malware & Threats

The NSA and FBI warn that a Chinese state-sponsored APT called BlackTech is hacking into network edge devices and using firmware implants to silently...


No one combatting cybercrime knows everything, but everyone in the battle has some intelligence to contribute to the larger knowledge base.

Application Security

Virtualization technology giant VMware on Tuesday shipped urgent updates to fix a trio of security problems in multiple software products, including a virtual machine...

Malware & Threats

Unpatched and unprotected VMware ESXi servers worldwide have been targeted in a ransomware attack exploiting a vulnerability patched in 2021.


The recent ransomware attack targeting Rackspace was conducted by a cybercrime group named Play using a new exploitation method, the cloud company revealed this...

Malware & Threats

Threat actors are increasingly abusing Microsoft OneNote documents to deliver malware in both targeted and spray-and-pray campaigns.