May 9, 2016 By Larry Loeb 2 min read

Security researcher John Castro recently found an interesting WordPress hack. His analysis of the malware was published on the Sucuri blog.

It’s All in the Header

In all observed infections, the malware injected 10 to 12 lines of code at the top of the header.php file of the WordPress theme in use. The header code isn’t very complex; it will redirect visitors to a certain malicious site if it is their first visit after the initial infection.

Next, it will set a cookie to track returning visitors for one year and tests for search engine crawlers. If the coast is clear, it checks the user agent header.

The header also performs random redirects to a number of malicious domains. However, when the use of Internet Explorer is detected, the redirect heads to a website that pushes out a fake Flash or Java update, which could actually be a known malware, Sucuri noted.

Quirks in the Malware

The malware code is not perfect. For example, it may test for a certain parameter without making sure that it exists, which causes a PHP error. This is not always shown since servers may have PHP notices turned off, but checking with a simple Google search may show it exists on your server.

According to Sucuri, those same search results could also show errors in the footer file; a previous version of the malware tried the same trick with different code and placed it there. While developers may have updated the malware, the redirects end up sending users to the same pages.

More to the WordPress Hack

The blog was not sanguine about this type of exploit being the only one on a site.

“In most cases, the infected sites had multiple vulnerabilities,” Sucuri said. “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.”

That brings up another major point: Attackers may have admin credentials for the site and can manually edit the header file to inject the code for the redirect attack. Even if the malware is removed, it’s critical to change all passwords and check for rogue admin accounts that may have been introduced.

More from

Apple Intelligence raises stakes in privacy and security

3 min read - Apple’s latest innovation, Apple Intelligence, is redefining what’s possible in consumer technology. Integrated into iOS 18.1, iPadOS 18.1 and macOS Sequoia 15.1, this milestone puts advanced artificial intelligence (AI) tools directly in the hands of millions. Beyond being a breakthrough for personal convenience, it represents an enormous economic opportunity. But the bold step into accessible AI comes with critical questions about security, privacy and the risks of real-time decision-making in users’ most private digital spaces.AI in every pocketHaving sophisticated AI…

Government cybersecurity in 2025: Former Principal Deputy National Cyber Director weighs in

4 min read - As 2024 comes to an end, it’s time to look ahead to the state of public cybersecurity in 2025.The good news is this: Cybersecurity will be an ongoing concern for the government regardless of the party in power, as many current cybersecurity initiatives are bipartisan. But what will government cybersecurity look like in 2025?Will the country be better off than they are today? What are the positive signs that could signal a good year for national cybersecurity? And what threats should…

FYSA – Adobe Cold Fusion Path Traversal Vulnerability

2 min read - Summary Adobe has released a security bulletin (APSB24-107) addressing an arbitrary file system read vulnerability in ColdFusion, a web application server. The vulnerability, identified as CVE-2024-53961, can be exploited to read arbitrary files on the system, potentially leading to unauthorized access and data exposure. Threat Topography Threat Type: Arbitrary File System Read Industries Impacted: Technology, Software, and Web Development Geolocation: Global Environment Impact: Web servers running ColdFusion 2021 and 2023 are vulnerable Overview X-Force Incident Command is monitoring the disclosure…

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today