Security Experts:

Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

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.

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 contributing 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

Expert Insights

Related Content

Malware & Threats

Microsoft plans to improve the protection of Office users by blocking XLL add-ins from the internet.

Cybercrime

CISA, NSA, and MS-ISAC issued an alert on the malicious use of RMM software to steal money from bank accounts.

Cybercrime

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...

Cybercrime

Chinese threat actor DragonSpark has been using the SparkRAT open source backdoor in attacks targeting East Asian organizations.

Cyberwarfare

Russia-linked cyberespionage group APT29 has been observed using embassy-themed lures and the GraphicalNeutrino malware in recent attacks.

Malware & Threats

Security researchers are warning of a new wave of malicious NPM and PyPI packages designed to steal user information and download additional payloads.

Cybercrime

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

Cybercrime

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