{"id":126,"date":"2018-12-10T09:20:02","date_gmt":"2018-12-10T09:20:02","guid":{"rendered":"https:\/\/beta.smarthost.eu\/blog\/?p=126"},"modified":"2019-03-26T09:21:37","modified_gmt":"2019-03-26T09:21:37","slug":"how-to-protect-wordpress-an-example-of-break-in-and-protection-against-infection","status":"publish","type":"post","link":"https:\/\/www.smarthost.au\/blog\/how-to-protect-wordpress-an-example-of-break-in-and-protection-against-infection","title":{"rendered":"How to protect WordPress &#8211; an example of break-in and protection against infection"},"content":{"rendered":"\n<p> Gaps happen in every software. The more popular, the greater the chance that someone will find a gap in it. An example of such gap has recently been present in the very popular GDPR Compliance plugin. The gap was quickly patched by the developers of the plugin, but even a short time was enough for the infections that took place immediately by browsing websites (as it has been shown in the internet forums). Previously, a similar wave of infections was performed by the attacks of the Duplicator plugin.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> How to protect WordPress from infection?<\/h3>\n\n\n\n<p>  There are huge studies on this subject, but one can assume that the general principle is that the themes, plugins and WordPress itself are up to date. Of course, you can perform various other forms of security, but for novice users, a constant system updates should significantly increase the level of resistance to intrusion.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> And what if keeping up to date system is not enough?<\/h3>\n\n\n\n<p>\nSometimes\nthere is a gap in the software. As\nlong as the software developers do not patch the vulnerability and\nprovide access to the new version of the downloadable software, it\nmay happen that the site is vulnerable to hacking. In this case, for\nexample, you can disable the &#8220;leaky&#8221; plug-in and wait for\nit to be updated. However, it may happen that the update is not\nquickly enough<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> What are the side effects of hacking the website? <\/h3>\n\n\n\n<p> When the software is vulnerable, the most common way to attack is to attach a snippet of code to existing files on the file server. These fragments are usually encoded into an unreadable form for the ordinary user. After adding the code to the files, they can have different negative effects, e.g.:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>spam mailing,<\/li><li> launching the console (so-called bind shell), which can be used to &#8220;open&#8221; the server for break-ins for future use,<\/li><li> waiting for a sign to take part in a DDoS (Distributed Denial of Service) attack on some other websites (e.g.: bank or office sites),<\/li><li> displaying content that links to other websites (link form)<\/li><li> impersonation (phishing) \u2013 displaying, for example, a fake bank website or payment systems used for phishing.<\/li><\/ul>\n\n\n\n<p>\nEach\nof these most popular attack effects is very unfavorable and you\nshould do everything to ensure that this pasted code does not appear\non our website.<\/p>\n\n\n\n<p> Each of these most popular attack effects is very unfavorable and you should do everything to ensure that this pasted code does not appear on our website.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> What does the WordPress hacking look like? <\/h3>\n\n\n\n<p> Below is an example of a file that has been infected by sticking an encrypted piece of code into it. This is a file from the popular (over 300,000 installations) WordPress plugin called: MailPoet Newsletters.<\/p>\n\n\n\n<p>The file is located in the directory: \/wp-content\/plugins\/wysija-newsletters\/core\/autoloader.php<br><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/beta.smarthost.eu\/blog\/wp-content\/uploads\/2019\/03\/wordpress_1-1024x630.jpg\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_1-1024x630.jpg 1024w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_1-300x185.jpg 300w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_1-768x472.jpg 768w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_1.jpg 1081w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>See the code attached? And you should already notice that \ud83d\ude09 Although at first glance, the file looks quite ordinary. However, pay attention to the horizontal scroll bar&#8230;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/beta.smarthost.eu\/blog\/wp-content\/uploads\/2019\/03\/wordpress_2-1024x630.jpg\" alt=\"\" class=\"wp-image-131\" srcset=\"https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_2-1024x630.jpg 1024w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_2-300x185.jpg 300w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_2-768x472.jpg 768w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_2.jpg 1081w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p> Just move this bar slightly to the right and you can see immediately that in the first line after a few hundred spaces there is a fragment that should not be there!<\/p>\n\n\n\n<p>Another option is to switch the view to &#8220;wrapping lines&#8221; &#8211; you can also see the beautifully attached code right away&#8230;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/beta.smarthost.eu\/blog\/wp-content\/uploads\/2019\/03\/wordpress_3-1024x630.jpg\" alt=\"\" class=\"wp-image-129\" srcset=\"https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_3-1024x630.jpg 1024w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_3-300x185.jpg 300w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_3-768x472.jpg 768w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/wordpress_3.jpg 1081w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>This particular infection is the result of a breach in the GDPR Compliance plugin. Interestingly, the code was detected while moving the page to our server from one of the hosting companies specializing in the so-called hosting for WordPress. The customer told us that the break-in was diagnosed and specialists removed its effects. As it turned out, the removal of the effects was not complete.<\/p>\n\n\n\n<p>And how should we know that the files are infected? Because we have a special system that detects and protects against intrusions&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Anti-exploit system &#8211; effective anti-intrusion protection system for WordPress<\/h3>\n\n\n\n<p> We have a special protection system installed on all Smarthost.pl hosting accounts &#8211; a system that checks every file at the time of its modification. It is not important whether the modification is done by uploading the file via ftp, sftp, or uploaded the file in front of the form on the page, or &#8230; uploaded using the gap in the certain theme or plugin.<br><br> From the point of view of the anti-eploit system, it is important that the file is modified on the disk. In this case, the system checks if the file contains malicious code. The anti-exploit system contains a database of several thousand known malicious scripts. The malicious scripts are fortunately relatively easily to recognize (as it can be noticed in the examples above) &#8211; in a simple and effective way, it is possible to detect and block a file containing such malicious code on the server.<br><br> The anti-exploit scanner also checks files for viruses based on a database of known viruses, which in combination with the exploit signatures creates a very effective barrier against attacks.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"309\" src=\"https:\/\/beta.smarthost.eu\/blog\/wp-content\/uploads\/2019\/03\/hosting.jpg\" alt=\"\" class=\"wp-image-128\" srcset=\"https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/hosting.jpg 593w, https:\/\/www.smarthost.au\/blog\/wp-content\/uploads\/2019\/03\/hosting-300x156.jpg 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure><\/div>\n\n\n\n<p>In addition to blocking malicious scripts, the anti-exploit system also sends the information to the website-owner that certain attempts have been performed in order to save a file containing malware. It gives a convenient tool for taking care of your own website.<br><br> Does the anti-exploit system detect all intrusion attempts? Probably not &#8230; but the ones that it detects is the sufficient reason, that since two years of its use we did not have a single request coming from our customers to recreate the page from the backup &#8220;because it was hacked&#8221;. This indicates clearly its effectiveness. We publish a server file scan report for 2016 online here:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">If you need a security system against uploading a malware software to your website<br><br>just move to our hosting site that cares about the security of clients&#8217; files<\/h4>\n\n\n\n<p>\nMigration\nto our hosting site is free, we do it efficiently and quickly,\nwithout a significant interruption in the operation of the website\n(you can find more information on the migration to our hosting site\non this following webpage)<\/p>\n\n\n\n<p>\nThe\nanti-explite system (read more about it) works on each of our hosting\naccounts:<\/p>\n\n\n\n<p>\n<strong>In\nthe background. Unnoticeable. Efficiently.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"text-align:center\"> Check out our hosting packages<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Gaps happen in every software. The more popular, the greater the chance that someone will find a gap in it. An example of such gap has recently been present in the very popular GDPR Compliance<a class=\"read-more\" href=\"https:\/\/www.smarthost.au\/blog\/how-to-protect-wordpress-an-example-of-break-in-and-protection-against-infection\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":136,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,59,40,8],"tags":[95,48,88,90,86,94,87,91,93,89,92,96],"class_list":["post-126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-anti-exploit-system","category-break-in-analysis","category-exploit","category-security","tag-anti-exploit-protection","tag-anti-exploit-system","tag-exploits","tag-malicious-code","tag-post-invasion-analysis","tag-security-against-code-embedding","tag-sticking-to-malicious-code","tag-trojan-on-the-site","tag-website-hacking","tag-wordpress-exploits","tag-wordpress-hacking","tag-wordpress-security"],"_links":{"self":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":3,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/posts\/126\/revisions\/133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/media\/136"}],"wp:attachment":[{"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smarthost.au\/blog\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}