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

Taking the complexity out of identity solutions for hybrid environments

4 min read - For the past two decades, businesses have been making significant investments to consolidate their identity and access management (IAM) platforms and directories to manage user identities in one place. However, the hybrid nature of the cloud has led many to realize that this ultimate goal is a fantasy. Instead, businesses must learn how to consistently and effectively manage user identities across multiple IAM platforms and directories. As cloud migration and digital transformation accelerate at a dizzying pace, enterprises are left…

IBM identifies zero-day vulnerability in Zyxel NAS devices

12 min read - While investigating CVE-2023-27992, a vulnerability affecting Zyxel network-attached storage (NAS) devices, the IBM X-Force uncovered two new flaws, which when used together, allow for pre-authenticated remote code execution. Zyxel NAS devices are typically used by consumers as cloud storage devices for homes or small to medium-sized businesses. When used together, the flaws X-Force discovered allow a remote attacker to execute arbitrary code on the device with superuser permissions and without requiring any credentials. This results in complete control over the…

What cybersecurity pros can learn from first responders

4 min read - Though they may initially seem very different, there are some compelling similarities between cybersecurity professionals and traditional first responders like police and EMTs. After all, in a world where a cyberattack on critical infrastructure could cause untold damage and harm, cyber responders must be ready for anything. But are they actually prepared? Compared to the readiness of traditional first responders, how do cybersecurity professionals in incident response stand up? Let’s dig deeper into whether the same sense of urgency exists…

Unified endpoint management for purpose-based devices

4 min read - As purpose-built devices become increasingly common, the challenges associated with their unique management and security needs are becoming clear. What are purpose-built devices? Most fall under the category of rugged IoT devices typically used outside of an office environment and which often run on a different operating system than typical office devices. Examples include ruggedized tablets and smartphones, handheld scanners and kiosks. Many different industries are utilizing purpose-built devices, including travel and transportation, retail, warehouse and distribution, manufacturing (including automotive)…

Topic updates

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