WordPress is considered as the best Content Management System (CMS). Being a popular CMS platform, WordPress powered websites are the most attractive target for hackers. In 2010, Pharma hack was one of the serious threat to WordPress sites. Although WordPress themes like The Thesis Theme team, StudioPress Themes, and WordPress core developers are trying to make it more secure, so its the best practice to keep your WordPress powered site always up to date and use the online tools like Sucuri to know more about the latest threats and Malware to make it more safe and secure.
The three red arrows highlight
What is a Pharma Hack
If your website looks like pharmacy related website instead of helpful Web resource or not displaying your content on searching of keywords on Google or other search engines, Its mean your site is affected by WordPress Pharma hack. The users when trying to search your website with a required keyword, the search engine will not display your site, it will display pharmaceuticals companies related web pages. According to Pearsonified: who was effected by WordPress pharma hack also written a detailed article on WordPress Pharma hack.The WordPress pharma hack quietly exploits your highest-ranking and most valuable pages by overriding the title tag and by inserting spammy links into the page content. Interestingly, the modified title tag and spammy links are only visible to search engines.
The three red arrows highlight <title> tags that were cloaked by the WordPress pharma hack.
This is the big loss for site owners because they tried enough to get good traffic, but they never know their traffic is not coming from search engines and traffic going down every day because hackers have put their malicious code in your web pages that replacing your links and Google description by stealing search links.
There are a lot of tutorials and articles on Preventing WordPress powered website from hackers. Some of the best tutorials available on WPArena are:
- How to find remove and protect WordPress site from malware
- Identifying removing and preventing malware on your WordPress site
Understanding WordPress Pharma Hack Penetration
There are different ways attackers insert the malicious code into a WordPress file to get control over the database, plugins files even on WordPress core files like adding code in .htaccess file. According to Sucuri which can provide the best protection service for your websites and web servers, there are three parts for WordPress pharma hack to add malicious code:- The backdoor that allows the attackers to insert files and modify the database.
- Backdoor inside one (or more) plugins to insert the spam.
- Backdoor inside the database used by the plugins.
eval() and base64_decode() but this kind of hack is not the exception for such kind of hack. The only difference with Pharma hack inclusion, these functions stored in the WordPress database as strings, and they’re encoded backward! which open the backdoor for a further run the string from the database. At runtime, a hack file in the plugins folder pulls these strings from the database, flips ‘em, and then runs ‘em as functions, and that’s how the deed gets done.
The hack pings Google Blog Search with queries like this one to see how many links a particular page has, and then it stores the results in the database. At runtime, the hack uses the number of links to determine which pages to target. [Source: WordPress Pharma hack ]
WordPress Pharma Hack Affects
In most (not all) cases the spammy links and/or content is cloaked or hidden from the visitors of your site, it is only visible to search engine bots. When a search engine bot makes a request for a page on your site in addition to the page being requested a search engine bot will identify itself in the user agent field. Scripting languages such as PHP and javascript can read this value and determine when the request is coming from a search engine bot. The form of the pharma hack varies from site to site, it can hit a single page or 1000s of pages, on some sites the hackers add 100s of hidden links to on-line pharmacy sites to the legitimate pages of a site. On other sites, the hackers use a cloaked or conditional hack which returns the spammy content only to a search engine bot. Another common method is to add a PHP file to the site that returns the spammy content. The methods for accomplishing a pharma hack also vary from site to site, from some generic methods effective against all sites to more specific ways that target the sites' CMS such as WordPress or Joomla. [Source: Spam Hacks, The Pharmacy Hack, The Porn Hack] According to a research Pharma Hack typically affects websites in three ways:- Results are visible on search engines only
- Tough to eliminate
- Highest ranked pages are targeted
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (google|yahoo) [OR]
RewriteCond %{HTTP_REFERER} (google|aol|yahoo)
RewriteCond %{REQUEST_URI} /$ [OR]
RewriteCond %{REQUEST_FILENAME} (html|htm|php)$ [NC]
RewriteCond %{REQUEST_FILENAME} !common.php
RewriteCond /home/xyz/public_html/common.php -f
RewriteRule ^.*$ /common.php [L]
</IfModule>
Again, the final file (common.php) was planted. [Source: Pharmahack]




![The Complete WordPress Security Guide [year] – Step by Step](/_next/image/?url=https%3A%2F%2Fadmin.wparena.com%2Fwp-content%2Fuploads%2F2017%2F11%2FWordPress-Security.png&w=3840&q=75)


Responses (1 )