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.

Advertisement. Scroll to continue reading.

“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 senior managing editor at SecurityWeek. He worked as a high school IT teacher before starting a career in journalism in 2011. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Click to comment

Trending

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 this live webinar as we explore why exploitation is outpacing remediation, where risk is growing fastest, and what security leaders can do to close the gap before attackers take advantage.

Register

CodeSecCon bridges the gap between dev and security. Discover best practices for secure coding, innovative risk-reduction tools, and safe AI integration to cultivate a true DevSecOps culture. Safely secure your apps!

Register

People on the Move

Jazz has named Sean Robinson, Rickie Goyal, Danielle Guetta, Shani Nago, and Lior Magram as VPs and Michael Calev as COO.

AJ Shipley has been appointed Chief Product Officer at CrowdStrike.

Brinqa has named Ron Dovich as Chief AI and Automation Officer, David Allen as CTO, Steve Biagioni as CFO, and James Walta as VP of Product.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.